lib/law.js
function(propName, updater) {
    var updaterName, handler;

    if(!isFunction(updater)) {
      updaterName = 'update' + propName[0].toUpperCase() + propName.slice(1);
      updater = this.governor[updaterName];
    }

    if(updater) {
      this.then(function(advisorEvent, deferred, consequenceActions, streamEvent) {
        var currVal = this.props[propName].value;
        var updaterArgs = [currVal].concat(advisorEvent, streamEvent);
        var retVal = updater.apply(this, updaterArgs);

        // Only trigger a reactive change if the value has actually changed;
        // if(!isEqual(retVal, currVal)) this.props[propName] = retVal;
        this.props[propName] = retVal

        deferred.resolve(retVal);
      });
    } else {
      throw new Error('An updater function was not specified and governor.' + updaterName + ' is not defined');
    }

    return this;
  }
function(propName, updater) {
    var updaterName, handler;

    if(!isFunction(updater)) {
      updaterName = 'update' + propName[0].toUpperCase() + propName.slice(1);
      updater = this.governor[updaterName];
    }

    if(updater) {
      this.then(function(advisorEvent, deferred, consequenceActions, streamEvent) {
        var currVal = this.props[propName].value;
        var updaterArgs = [currVal].concat(advisorEvent, streamEvent);
        var retVal = updater.apply(this, updaterArgs);

        // Only trigger a reactive change if the value has actually changed;
        // if(!isEqual(retVal, currVal)) this.props[propName] = retVal;
        this.props[propName] = retVal

        deferred.resolve(retVal);
      });
    } else {
      throw new Error('An updater function was not specified and governor.' + updaterName + ' is not defined');
    }

    return this;
  }
function ( propName , updater ) { var updaterName , handler ; if ( ! isFunction ( updater ) ) { updaterName = 'update' + propName [ 0 ] . toUpperCase ( ) + propName . slice ( 1 ) ; updater = this . governor [ updaterName ] ; } if ( updater ) { this . then ( function ( advisorEvent , deferred , consequenceActions , streamEvent ) { var currVal = this . props [ propName ] . value ; var updaterArgs = [ currVal ] . concat ( advisorEvent , streamEvent ) ; var retVal = updater . apply ( this , updaterArgs ) ; // Only trigger a reactive change if the value has actually changed; // if(!isEqual(retVal, currVal)) this.props[propName] = retVal; this . props [ propName ] = retVal deferred . resolve ( retVal ) ; } ) ; } else { throw new Error ( 'An updater function was not specified and governor.' + updaterName + ' is not defined' ) ; } return this ; }
Indicate which property update function should be called in response to
Advisor events.

@function updateProp
@name updateProp
@instance
@memberof Law
Indicate which property update function should be called in response to Advisor events .