src/core/context/node.js
/**
   * Add or update a subscriber with a specified ID. If subscriber doesn't
   * yet exist, it will be created using the specified factory. The use
   * of factory is important to reduce bundling costs for context node.
   * If `func` returns a function, that function is called on cleanup.
   *
   * @param {SID} id
   * @param {typeof import('./subscriber').Subscriber} Ctor
   * @param {import('./subscriber').SubscribeCallback<DEP>} func
   * @param {IContextProp<DEP, ?>[]} deps
   * @template DEP
   */
Add or update a subscriber with a specified ID. If subscriber doesn't
yet exist, it will be created using the specified factory. The use
of factory is important to reduce bundling costs for context node.
If `func` returns a function, that function is called on cleanup.


Add or update a subscriber with a specified ID . If subscriber doesn ' t yet exist it will be created using the specified factory . The use of factory is important to reduce bundling costs for context node . If ` func ` returns a function that function is called on cleanup .
subscribe(id, Ctor, func, deps) {
    const subscribers = this.subscribers_ || (this.subscribers_ = new Map());
    let subscriber = subscribers.get(id);
    if (!subscriber) {
      subscriber = new Ctor(
         (
           (this)
        ),
        func,
        deps
      );
      subscribers.set(id, subscriber);
    }
  }
subscribe ( id , Ctor , func , deps ) { const subscribers = this . subscribers_ || ( this . subscribers_ = new Map ( ) ) ; let subscriber = subscribers . get ( id ) ; if ( ! subscriber ) { subscriber = new Ctor ( ( ( this ) ) , func , deps ) ; subscribers . set ( id , subscriber ) ; } }
Add or update a subscriber with a specified ID.
Add or update a subscriber with a specified ID .
/** @type {ContextNode<function(...DEP):void>} */ /** @type {?} */