src/index.js
/**
     * @summary Registers `callback` to run when this computation is next invalidated, or runs it immediately if the computation is already invalidated.  The callback is run exactly once and not upon future invalidations unless `onInvalidate` is called again after the computation becomes valid again.
     * @locus Client
     * @param {Function} callback Function to be called on invalidation. Receives one argument, the computation that was invalidated.
     */
@summary Registers `callback` to run when this computation is next invalidated, or runs it immediately if the computation is already invalidated.  The callback is run exactly once and not upon future invalidations unless `onInvalidate` is called again after the computation becomes valid again.
@locus Client
@param {Function} callback Function to be called on invalidation. Receives one argument, the computation that was invalidated.
@summary Registers ` callback ` to run when this computation is next invalidated or runs it immediately if the computation is already invalidated . The callback is run exactly once and not upon future invalidations unless ` onInvalidate ` is called again after the computation becomes valid again . @locus Client @param { Function } callback Function to be called on invalidation . Receives one argument the computation that was invalidated .
onInvalidate(f) {
      let self = this;
      if (typeof f !== 'function')
        throw new Error("onInvalidate requires a function");
      if (self.invalidated) {
        Tracker.nonreactive(function () {
          withNoYieldsAllowed(f)(self);
        });
      } else {
        self._onInvalidateCallbacks.push(f);
      }
    }
onInvalidate ( f ) { let self = this ; if ( typeof f !== 'function' ) throw new Error ( "onInvalidate requires a function" ) ; if ( self . invalidated ) { Tracker . nonreactive ( function ( ) { withNoYieldsAllowed ( f ) ( self ) ; } ) ; } else { self . _onInvalidateCallbacks . push ( f ) ; } }
@summary Registers `callback` to run when this computation is next invalidated, or runs it immediately if the computation is already invalidated.
@summary Registers ` callback ` to run when this computation is next invalidated or runs it immediately if the computation is already invalidated .