@loopback/context 1.25.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/binding-filter.d.ts +19 -1
  3. package/dist/binding-filter.js +40 -7
  4. package/dist/binding-filter.js.map +1 -1
  5. package/dist/binding.d.ts +33 -1
  6. package/dist/binding.js +14 -1
  7. package/dist/binding.js.map +1 -1
  8. package/dist/context-event.d.ts +23 -0
  9. package/dist/context-event.js +7 -0
  10. package/dist/context-event.js.map +1 -0
  11. package/dist/context-observer.d.ts +1 -36
  12. package/dist/context-subscription.d.ts +147 -0
  13. package/dist/context-subscription.js +336 -0
  14. package/dist/context-subscription.js.map +1 -0
  15. package/dist/context-tag-indexer.d.ts +42 -0
  16. package/dist/context-tag-indexer.js +134 -0
  17. package/dist/context-tag-indexer.js.map +1 -0
  18. package/dist/context-view.d.ts +2 -1
  19. package/dist/context-view.js.map +1 -1
  20. package/dist/context.d.ts +29 -65
  21. package/dist/context.js +50 -245
  22. package/dist/context.js.map +1 -1
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +1 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/inject.d.ts +1 -1
  27. package/dist/interceptor.js +4 -4
  28. package/dist/interceptor.js.map +1 -1
  29. package/dist/invocation.d.ts +0 -1
  30. package/dist/invocation.js +1 -5
  31. package/dist/invocation.js.map +1 -1
  32. package/dist/value-promise.d.ts +1 -3
  33. package/package.json +7 -7
  34. package/src/binding-filter.ts +61 -9
  35. package/src/binding.ts +43 -1
  36. package/src/context-event.ts +30 -0
  37. package/src/context-observer.ts +1 -38
  38. package/src/context-subscription.ts +403 -0
  39. package/src/context-tag-indexer.ts +149 -0
  40. package/src/context-view.ts +2 -5
  41. package/src/context.ts +71 -286
  42. package/src/index.ts +2 -0
  43. package/src/interceptor.ts +7 -6
  44. package/src/invocation.ts +1 -3
  45. package/src/value-promise.ts +1 -1
package/dist/context.d.ts CHANGED
@@ -5,7 +5,10 @@ import { ConfigurationResolver } from './binding-config';
5
5
  import { BindingFilter } from './binding-filter';
6
6
  import { BindingAddress } from './binding-key';
7
7
  import { BindingComparator } from './binding-sorter';
8
- import { ContextEventObserver, ContextEventType, ContextObserver, Subscription } from './context-observer';
8
+ import { ContextEvent } from './context-event';
9
+ import { ContextEventObserver, ContextObserver } from './context-observer';
10
+ import { ContextSubscriptionManager, Subscription } from './context-subscription';
11
+ import { ContextTagIndexer } from './context-tag-indexer';
9
12
  import { ContextView } from './context-view';
10
13
  import { ResolutionOptions, ResolutionOptionsOrSession, ResolutionSession } from './resolution-session';
11
14
  import { BoundValue, ValueOrPromise } from './value-promise';
@@ -22,30 +25,21 @@ export declare class Context extends EventEmitter {
22
25
  */
23
26
  protected readonly registry: Map<string, Binding>;
24
27
  /**
25
- * Parent context
28
+ * Indexer for bindings by tag
26
29
  */
27
- protected _parent?: Context;
28
- protected configResolver: ConfigurationResolver;
30
+ protected readonly tagIndexer: ContextTagIndexer;
29
31
  /**
30
- * Event listeners for parent context keyed by event names. It keeps track
31
- * of listeners from this context against its parent so that we can remove
32
- * these listeners when this context is closed.
32
+ * Manager for observer subscriptions
33
33
  */
34
- protected _parentEventListeners: Map<string, (...args: any[]) => void> | undefined;
34
+ readonly subscriptionManager: ContextSubscriptionManager;
35
35
  /**
36
- * A list of registered context observers. The Set will be created when the
37
- * first observer is added.
38
- */
39
- protected observers: Set<ContextEventObserver> | undefined;
40
- /**
41
- * Internal counter for pending notification events which are yet to be
42
- * processed by observers.
36
+ * Parent context
43
37
  */
44
- private pendingNotifications;
38
+ protected _parent?: Context;
45
39
  /**
46
- * Queue for background notifications for observers
40
+ * Configuration resolver
47
41
  */
48
- private notificationQueue;
42
+ protected configResolver: ConfigurationResolver;
49
43
  /**
50
44
  * Create a new context.
51
45
  *
@@ -69,6 +63,11 @@ export declare class Context extends EventEmitter {
69
63
  * generated as the name
70
64
  */
71
65
  constructor(_parent?: Context | string, name?: string);
66
+ /**
67
+ * @internal
68
+ * Getter for ContextSubscriptionManager
69
+ */
70
+ get parent(): Context | undefined;
72
71
  /**
73
72
  * Wrap the debug statement so that it always print out the context name
74
73
  * as the prefix
@@ -76,44 +75,16 @@ export declare class Context extends EventEmitter {
76
75
  */
77
76
  private _debug;
78
77
  /**
79
- * Set up an internal listener to notify registered observers asynchronously
80
- * upon `bind` and `unbind` events. This method will be called lazily when
81
- * the first observer is added.
78
+ * A strongly-typed method to emit context events
79
+ * @param type Event type
80
+ * @param event Context event
82
81
  */
83
- private setupEventHandlersIfNeeded;
82
+ emitEvent<T extends ContextEvent>(type: string, event: T): void;
84
83
  /**
85
- * Add an event listener to its parent context so that this context will
86
- * be notified of parent events, such as `bind` or `unbind`.
87
- * @param event - Event name
84
+ * Emit an `error` event
85
+ * @param err Error
88
86
  */
89
- private addParentEventListener;
90
- /**
91
- * Handle errors caught during the notification of observers
92
- * @param err - Error
93
- */
94
- private handleNotificationError;
95
- /**
96
- * Start a background task to listen on context events and notify observers
97
- */
98
- private startNotificationTask;
99
- /**
100
- * Process notification events as they arrive on the queue
101
- */
102
- private processNotifications;
103
- /**
104
- * Listen on given event types and emit `notification` event. This method
105
- * merge multiple event types into one for notification.
106
- * @param eventTypes - Context event types
107
- */
108
- private setupNotification;
109
- /**
110
- * Wait until observers are notified for all of currently pending notification
111
- * events.
112
- *
113
- * This method is for test only to perform assertions after observers are
114
- * notified for relevant events.
115
- */
116
- protected waitUntilPendingNotificationsDone(timeout?: number): Promise<void>;
87
+ emitError(err: unknown): void;
117
88
  /**
118
89
  * Create a binding with the given key in the context. If a locked binding
119
90
  * already exists with the same key, an error will be thrown.
@@ -220,18 +191,6 @@ export declare class Context extends EventEmitter {
220
191
  * @param comparator - A function to sort matched bindings
221
192
  */
222
193
  createView<T = unknown>(filter: BindingFilter, comparator?: BindingComparator): ContextView<T>;
223
- /**
224
- * Publish an event to the registered observers. Please note the
225
- * notification is queued and performed asynchronously so that we allow fluent
226
- * APIs such as `ctx.bind('key').to(...).tag(...);` and give observers the
227
- * fully populated binding.
228
- *
229
- * @param eventType - Event names: `bind` or `unbind`
230
- * @param binding - Binding bound or unbound
231
- * @param context - Owner context
232
- * @param observers - Current set of context observers
233
- */
234
- protected notifyObservers(eventType: ContextEventType, binding: Readonly<Binding<unknown>>, context: Context, observers?: Set<ContextEventObserver> | undefined): Promise<void>;
235
194
  /**
236
195
  * Check if a binding exists with the given key in the local context without
237
196
  * delegating to the parent context
@@ -278,6 +237,11 @@ export declare class Context extends EventEmitter {
278
237
  * `{name: 'my-controller'}`
279
238
  */
280
239
  findByTag<ValueType = BoundValue>(tagFilter: BindingTag | RegExp): Readonly<Binding<ValueType>>[];
240
+ /**
241
+ * Find bindings by tag leveraging indexes
242
+ * @param tag - Tag name pattern or name/value pairs
243
+ */
244
+ protected _findByTagIndex<ValueType = BoundValue>(tag: BindingTag | RegExp): Readonly<Binding<ValueType>>[];
281
245
  protected _mergeWithParent<ValueType>(childList: Readonly<Binding<ValueType>>[], parentList?: Readonly<Binding<ValueType>>[]): Readonly<Binding<ValueType>>[];
282
246
  /**
283
247
  * Get the value bound to the given key, throw an error when no value is
package/dist/context.js CHANGED
@@ -3,13 +3,6 @@
3
3
  // Node module: @loopback/context
4
4
  // This file is licensed under the MIT License.
5
5
  // License text available at https://opensource.org/licenses/MIT
6
- var __asyncValues = (this && this.__asyncValues) || function (o) {
7
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
8
- var m = o[Symbol.asyncIterator], i;
9
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
10
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
11
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
12
- };
13
6
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
8
  };
@@ -21,24 +14,12 @@ const binding_1 = require("./binding");
21
14
  const binding_config_1 = require("./binding-config");
22
15
  const binding_filter_1 = require("./binding-filter");
23
16
  const binding_key_1 = require("./binding-key");
17
+ const context_subscription_1 = require("./context-subscription");
18
+ const context_tag_indexer_1 = require("./context-tag-indexer");
24
19
  const context_view_1 = require("./context-view");
25
20
  const keys_1 = require("./keys");
26
21
  const resolution_session_1 = require("./resolution-session");
27
22
  const value_promise_1 = require("./value-promise");
28
- /**
29
- * Polyfill Symbol.asyncIterator as required by TypeScript for Node 8.x.
30
- * See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html
31
- */
32
- if (!Symbol.asyncIterator) {
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
- Symbol.asyncIterator = Symbol.for('Symbol.asyncIterator');
35
- }
36
- /**
37
- * WARNING: This following import must happen after the polyfill. The
38
- * `auto-import` by an IDE such as VSCode may move the import before the
39
- * polyfill. It must be then fixed manually.
40
- */
41
- const p_event_1 = require("p-event");
42
23
  const debug = debug_1.default('loopback:context');
43
24
  /**
44
25
  * Context provides an implementation of Inversion of Control (IoC) container
@@ -72,24 +53,32 @@ class Context extends events_1.EventEmitter {
72
53
  * Key to binding map as the internal registry
73
54
  */
74
55
  this.registry = new Map();
75
- /**
76
- * Internal counter for pending notification events which are yet to be
77
- * processed by observers.
78
- */
79
- this.pendingNotifications = 0;
56
+ // The number of listeners can grow with the number of child contexts
57
+ // For example, each request can add a listener to the RestServer and the
58
+ // listener is removed when the request processing is finished.
59
+ // See https://github.com/strongloop/loopback-next/issues/4363
60
+ this.setMaxListeners(Infinity);
80
61
  if (typeof _parent === 'string') {
81
62
  name = _parent;
82
63
  _parent = undefined;
83
64
  }
84
65
  this._parent = _parent;
85
66
  this.name = (name !== null && name !== void 0 ? name : uuid_1.v1());
67
+ this.tagIndexer = new context_tag_indexer_1.ContextTagIndexer(this);
68
+ this.subscriptionManager = new context_subscription_1.ContextSubscriptionManager(this);
69
+ }
70
+ /**
71
+ * @internal
72
+ * Getter for ContextSubscriptionManager
73
+ */
74
+ get parent() {
75
+ return this._parent;
86
76
  }
87
77
  /**
88
78
  * Wrap the debug statement so that it always print out the context name
89
79
  * as the prefix
90
80
  * @param args - Arguments for the debug
91
81
  */
92
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
93
82
  _debug(...args) {
94
83
  /* istanbul ignore if */
95
84
  if (!debug.enabled)
@@ -103,162 +92,20 @@ class Context extends events_1.EventEmitter {
103
92
  }
104
93
  }
105
94
  /**
106
- * Set up an internal listener to notify registered observers asynchronously
107
- * upon `bind` and `unbind` events. This method will be called lazily when
108
- * the first observer is added.
95
+ * A strongly-typed method to emit context events
96
+ * @param type Event type
97
+ * @param event Context event
109
98
  */
110
- setupEventHandlersIfNeeded() {
111
- if (this.notificationQueue != null)
112
- return;
113
- this.addParentEventListener('bind');
114
- this.addParentEventListener('unbind');
115
- // The following are two async functions. Returned promises are ignored as
116
- // they are long-running background tasks.
117
- this.startNotificationTask().catch(err => {
118
- this.handleNotificationError(err);
119
- });
120
- let ctx = this._parent;
121
- while (ctx) {
122
- ctx.setupEventHandlersIfNeeded();
123
- ctx = ctx._parent;
124
- }
125
- }
126
- /**
127
- * Add an event listener to its parent context so that this context will
128
- * be notified of parent events, such as `bind` or `unbind`.
129
- * @param event - Event name
130
- */
131
- addParentEventListener(event) {
132
- var _a;
133
- if (this._parent == null)
134
- return;
135
- // Keep track of parent event listeners so that we can remove them
136
- this._parentEventListeners = (_a = this._parentEventListeners, (_a !== null && _a !== void 0 ? _a : new Map()));
137
- if (this._parentEventListeners.has(event))
138
- return;
139
- const parentEventListener = (binding, context) => {
140
- // Propagate the event to this context only if the binding key does not
141
- // exist in this context. The parent binding is shadowed if there is a
142
- // binding with the same key in this one.
143
- if (this.contains(binding.key)) {
144
- this._debug('Event %s %s is not re-emitted from %s to %s', event, binding.key, context.name, this.name);
145
- return;
146
- }
147
- this._debug('Re-emitting %s %s from %s to %s', event, binding.key, context.name, this.name);
148
- this.emit(event, binding, context);
149
- };
150
- this._parentEventListeners.set(event, parentEventListener);
151
- // Listen on the parent context events
152
- this._parent.on(event, parentEventListener);
99
+ emitEvent(type, event) {
100
+ this.emit(type, event);
153
101
  }
154
102
  /**
155
- * Handle errors caught during the notification of observers
156
- * @param err - Error
103
+ * Emit an `error` event
104
+ * @param err Error
157
105
  */
158
- handleNotificationError(err) {
159
- // Bubbling up the error event over the context chain
160
- // until we find an error listener
161
- // eslint-disable-next-line @typescript-eslint/no-this-alias
162
- let ctx = this;
163
- while (ctx) {
164
- if (ctx.listenerCount('error') === 0) {
165
- // No error listener found, try its parent
166
- ctx = ctx._parent;
167
- continue;
168
- }
169
- this._debug('Emitting error to context %s', ctx.name, err);
170
- ctx.emit('error', err);
171
- return;
172
- }
173
- // No context with error listeners found
174
- this._debug('No error handler is configured for the context chain', err);
175
- // Let it crash now by emitting an error event
106
+ emitError(err) {
176
107
  this.emit('error', err);
177
108
  }
178
- /**
179
- * Start a background task to listen on context events and notify observers
180
- */
181
- startNotificationTask() {
182
- // Set up listeners on `bind` and `unbind` for notifications
183
- this.setupNotification('bind', 'unbind');
184
- // Create an async iterator for the `notification` event as a queue
185
- this.notificationQueue = p_event_1.iterator(this, 'notification');
186
- return this.processNotifications();
187
- }
188
- /**
189
- * Process notification events as they arrive on the queue
190
- */
191
- async processNotifications() {
192
- var e_1, _a;
193
- const events = this.notificationQueue;
194
- if (events == null)
195
- return;
196
- try {
197
- for (var events_2 = __asyncValues(events), events_2_1; events_2_1 = await events_2.next(), !events_2_1.done;) {
198
- const { eventType, binding, context, observers } = events_2_1.value;
199
- // The loop will happen asynchronously upon events
200
- try {
201
- // The execution of observers happen in the Promise micro-task queue
202
- await this.notifyObservers(eventType, binding, context, observers);
203
- this.pendingNotifications--;
204
- this._debug('Observers notified for %s of binding %s', eventType, binding.key);
205
- this.emit('observersNotified', { eventType, binding });
206
- }
207
- catch (err) {
208
- this.pendingNotifications--;
209
- this._debug('Error caught from observers', err);
210
- // Errors caught from observers. Emit it to the current context.
211
- // If no error listeners are registered, crash the process.
212
- this.emit('error', err);
213
- }
214
- }
215
- }
216
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
217
- finally {
218
- try {
219
- if (events_2_1 && !events_2_1.done && (_a = events_2.return)) await _a.call(events_2);
220
- }
221
- finally { if (e_1) throw e_1.error; }
222
- }
223
- }
224
- /**
225
- * Listen on given event types and emit `notification` event. This method
226
- * merge multiple event types into one for notification.
227
- * @param eventTypes - Context event types
228
- */
229
- setupNotification(...eventTypes) {
230
- for (const eventType of eventTypes) {
231
- this.on(eventType, (binding, context) => {
232
- // No need to schedule notifications if no observers are present
233
- if (!this.observers || this.observers.size === 0)
234
- return;
235
- // Track pending events
236
- this.pendingNotifications++;
237
- // Take a snapshot of current observers to ensure notifications of this
238
- // event will only be sent to current ones. Emit a new event to notify
239
- // current context observers.
240
- this.emit('notification', {
241
- eventType,
242
- binding,
243
- context,
244
- observers: new Set(this.observers),
245
- });
246
- });
247
- }
248
- }
249
- /**
250
- * Wait until observers are notified for all of currently pending notification
251
- * events.
252
- *
253
- * This method is for test only to perform assertions after observers are
254
- * notified for relevant events.
255
- */
256
- async waitUntilPendingNotificationsDone(timeout) {
257
- const count = this.pendingNotifications;
258
- if (count === 0)
259
- return;
260
- await p_event_1.multiple(this, 'observersNotified', { count, timeout });
261
- }
262
109
  /**
263
110
  * Create a binding with the given key in the context. If a locked binding
264
111
  * already exists with the same key, an error will be thrown.
@@ -290,9 +137,13 @@ class Context extends events_1.EventEmitter {
290
137
  this.registry.set(key, binding);
291
138
  if (existingBinding !== binding) {
292
139
  if (existingBinding != null) {
293
- this.emit('unbind', existingBinding, this);
140
+ this.emitEvent('unbind', {
141
+ binding: existingBinding,
142
+ context: this,
143
+ type: 'unbind',
144
+ });
294
145
  }
295
- this.emit('bind', binding, this);
146
+ this.emitEvent('bind', { binding, context: this, type: 'bind' });
296
147
  }
297
148
  return this;
298
149
  }
@@ -401,7 +252,7 @@ class Context extends events_1.EventEmitter {
401
252
  if ((_a = binding) === null || _a === void 0 ? void 0 : _a.isLocked)
402
253
  throw new Error(`Cannot unbind key "${key}" of a locked binding`);
403
254
  this.registry.delete(key);
404
- this.emit('unbind', binding, this);
255
+ this.emitEvent('unbind', { binding, context: this, type: 'unbind' });
405
256
  return true;
406
257
  }
407
258
  /**
@@ -409,20 +260,14 @@ class Context extends events_1.EventEmitter {
409
260
  * @param observer - Context observer instance or function
410
261
  */
411
262
  subscribe(observer) {
412
- var _a;
413
- this.observers = (_a = this.observers, (_a !== null && _a !== void 0 ? _a : new Set()));
414
- this.setupEventHandlersIfNeeded();
415
- this.observers.add(observer);
416
- return new ContextSubscription(this, observer);
263
+ return this.subscriptionManager.subscribe(observer);
417
264
  }
418
265
  /**
419
266
  * Remove the context event observer from the context
420
267
  * @param observer - Context event observer
421
268
  */
422
269
  unsubscribe(observer) {
423
- if (!this.observers)
424
- return false;
425
- return this.observers.delete(observer);
270
+ return this.subscriptionManager.unsubscribe(observer);
426
271
  }
427
272
  /**
428
273
  * Close the context: clear observers, stop notifications, and remove event
@@ -435,29 +280,15 @@ class Context extends events_1.EventEmitter {
435
280
  */
436
281
  close() {
437
282
  this._debug('Closing context...');
438
- this.observers = undefined;
439
- if (this.notificationQueue != null) {
440
- // Cancel the notification iterator
441
- this.notificationQueue.return(undefined).catch(err => {
442
- this.handleNotificationError(err);
443
- });
444
- this.notificationQueue = undefined;
445
- }
446
- if (this._parent && this._parentEventListeners) {
447
- for (const [event, listener] of this._parentEventListeners) {
448
- this._parent.removeListener(event, listener);
449
- }
450
- this._parentEventListeners = undefined;
451
- }
283
+ this.subscriptionManager.close();
284
+ this.tagIndexer.close();
452
285
  }
453
286
  /**
454
287
  * Check if an observer is subscribed to this context
455
288
  * @param observer - Context observer
456
289
  */
457
290
  isSubscribed(observer) {
458
- if (!this.observers)
459
- return false;
460
- return this.observers.has(observer);
291
+ return this.subscriptionManager.isSubscribed(observer);
461
292
  }
462
293
  /**
463
294
  * Create a view of the context chain with the given binding filter
@@ -469,29 +300,6 @@ class Context extends events_1.EventEmitter {
469
300
  view.open();
470
301
  return view;
471
302
  }
472
- /**
473
- * Publish an event to the registered observers. Please note the
474
- * notification is queued and performed asynchronously so that we allow fluent
475
- * APIs such as `ctx.bind('key').to(...).tag(...);` and give observers the
476
- * fully populated binding.
477
- *
478
- * @param eventType - Event names: `bind` or `unbind`
479
- * @param binding - Binding bound or unbound
480
- * @param context - Owner context
481
- * @param observers - Current set of context observers
482
- */
483
- async notifyObservers(eventType, binding, context, observers = this.observers) {
484
- if (!observers || observers.size === 0)
485
- return;
486
- for (const observer of observers) {
487
- if (typeof observer === 'function') {
488
- await observer(eventType, binding, context);
489
- }
490
- else if (!observer.filter || observer.filter(binding)) {
491
- await observer.observe(eventType, binding, context);
492
- }
493
- }
494
- }
495
303
  /**
496
304
  * Check if a binding exists with the given key in the local context without
497
305
  * delegating to the parent context
@@ -540,6 +348,10 @@ class Context extends events_1.EventEmitter {
540
348
  * - return `false` to exclude it.
541
349
  */
542
350
  find(pattern) {
351
+ // Optimize if the binding filter is for tags
352
+ if (typeof pattern === 'function' && binding_filter_1.isBindingTagFilter(pattern)) {
353
+ return this._findByTagIndex(pattern.bindingTagPattern);
354
+ }
543
355
  const bindings = [];
544
356
  const filter = binding_filter_1.filterByKey(pattern);
545
357
  for (const b of this.registry.values()) {
@@ -566,6 +378,16 @@ class Context extends events_1.EventEmitter {
566
378
  findByTag(tagFilter) {
567
379
  return this.find(binding_filter_1.filterByTag(tagFilter));
568
380
  }
381
+ /**
382
+ * Find bindings by tag leveraging indexes
383
+ * @param tag - Tag name pattern or name/value pairs
384
+ */
385
+ _findByTagIndex(tag) {
386
+ var _a;
387
+ const currentBindings = this.tagIndexer.findByTagIndex(tag);
388
+ const parentBindings = this._parent && ((_a = this._parent) === null || _a === void 0 ? void 0 : _a._findByTagIndex(tag));
389
+ return this._mergeWithParent(currentBindings, parentBindings);
390
+ }
569
391
  _mergeWithParent(childList, parentList) {
570
392
  if (!parentList)
571
393
  return childList;
@@ -695,23 +517,6 @@ class Context extends events_1.EventEmitter {
695
517
  }
696
518
  }
697
519
  exports.Context = Context;
698
- /**
699
- * An implementation of `Subscription` interface for context events
700
- */
701
- class ContextSubscription {
702
- constructor(context, observer) {
703
- this.context = context;
704
- this.observer = observer;
705
- this._closed = false;
706
- }
707
- unsubscribe() {
708
- this.context.unsubscribe(this.observer);
709
- this._closed = true;
710
- }
711
- get closed() {
712
- return this._closed;
713
- }
714
- }
715
520
  /**
716
521
  * Policy to control if a binding should be created for the context
717
522
  */
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,iCAAiC;AACjC,+CAA+C;AAC/C,gEAAgE;;;;;;;;;;;;AAEhE,kDAAiC;AACjC,mCAAoC;AACpC,+BAAkC;AAClC,uCAA8C;AAC9C,qDAG0B;AAC1B,qDAAyE;AACzE,+CAAyD;AASzD,iDAA2C;AAC3C,iCAAuC;AACvC,6DAK8B;AAC9B,mDAKyB;AAEzB;;;GAGG;AACH,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;IACzB,8DAA8D;IAC7D,MAAc,CAAC,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;CACpE;AACD;;;;GAIG;AACH,qCAA2C;AAE3C,MAAM,KAAK,GAAG,eAAY,CAAC,kBAAkB,CAAC,CAAC;AAE/C;;GAEG;AACH,MAAa,OAAQ,SAAQ,qBAAY;IAgDvC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,OAA0B,EAAE,IAAa;QACnD,KAAK,EAAE,CAAC;QAjEV;;WAEG;QACgB,aAAQ,GAAyB,IAAI,GAAG,EAAE,CAAC;QA4B9D;;;WAGG;QACK,yBAAoB,GAAG,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AC,CAAC;SAC1E;QAED,OAAO,+BAAe,CAAY,UAAU,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,MAAM,QAAQ,GAA2B,EAAE,CAAC;QAC5C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;YAClC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;SAC1B;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;OAGG;IACH,qGAAqG;IACrG,OAAO;QACL,MAAM,IAAI,GAA4B;YACpC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;SACxB,CAAC;QACF,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;SACtC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlvBD,0BAkvBC;AAED;;GAEG;AACH,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,iDAAwB,CAAA;IACxB;;;OAGG;IACH,+CAAsB,CAAA;IACtB;;;OAGG;IACH,2DAAkC,CAAA;AACpC,CAAC,EAfW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAehC"}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,9 @@ export * from './binding-inspector';
7
7
  export * from './binding-key';
8
8
  export * from './binding-sorter';
9
9
  export * from './context';
10
+ export * from './context-event';
10
11
  export * from './context-observer';
12
+ export * from './context-subscription';
11
13
  export * from './context-view';
12
14
  export * from './inject';
13
15
  export * from './inject-config';
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ __export(require("./binding-inspector"));
16
16
  __export(require("./binding-key"));
17
17
  __export(require("./binding-sorter"));
18
18
  __export(require("./context"));
19
+ __export(require("./context-subscription"));
19
20
  __export(require("./context-view"));
20
21
  __export(require("./inject"));
21
22
  __export(require("./inject-config"));
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,iCAAiC;AACjC,+CAA+C;AAC/C,gEAAgE;;;;;AAEhE,wCAAmC;AACnC,+BAA0B;AAC1B,sCAAiC;AACjC,yCAAoC;AACpC,sCAAiC;AACjC,yCAAoC;AACpC,mCAA8B;AAC9B,sCAAiC;AACjC,+BAA0B;AAE1B,oCAA+B;AAC/B,8BAAyB;AACzB,qCAAgC;AAChC,0CAAqC;AACrC,mCAA8B;AAC9B,yCAAoC;AACpC,kCAA6B;AAC7B,4BAAuB;AAEvB,0CAAqC;AACrC,gCAA2B;AAC3B,qCAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,iCAAiC;AACjC,+CAA+C;AAC/C,gEAAgE;;;;;AAEhE,wCAAmC;AACnC,+BAA0B;AAC1B,sCAAiC;AACjC,yCAAoC;AACpC,sCAAiC;AACjC,yCAAoC;AACpC,mCAA8B;AAC9B,sCAAiC;AACjC,+BAA0B;AAG1B,4CAAuC;AACvC,oCAA+B;AAC/B,8BAAyB;AACzB,qCAAgC;AAChC,0CAAqC;AACrC,mCAA8B;AAC9B,yCAAoC;AACpC,kCAA6B;AAC7B,4BAAuB;AAEvB,0CAAqC;AACrC,gCAA2B;AAC3B,qCAAgC"}
package/dist/inject.d.ts CHANGED
@@ -172,7 +172,7 @@ export declare namespace inject {
172
172
  * @param bindingTag - Tag name, regex or object
173
173
  * @param metadata - Optional metadata to help the injection
174
174
  */
175
- const tag: (bindingTag: string | RegExp | import("./value-promise").MapObject<any>, metadata?: InjectionMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
175
+ const tag: (bindingTag: string | RegExp | Record<string, any>, metadata?: InjectionMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
176
176
  /**
177
177
  * Inject matching bound values by the filter function
178
178
  *