extensions/amp-consent/0.1/consent-state-manager.js
/**
   * Register the handler for every consent state change.
   * @param {function(!ConsentInfoDef)} handler
   */
Register the handler for every consent state change.
Register the handler for every consent state change .
onConsentStateChange(handler) {
    devAssert(this.instance_,
        '%s: cannot find the instance', TAG);
    devAssert(!this.consentChangeHandler_,
        '%s: Duplicate consent change handler, will be ignored', TAG);
    this.consentChangeHandler_ = handler;
    this.getConsentInstanceInfo().then(info => {
      handler(info);
    });
  }
onConsentStateChange ( handler ) { devAssert ( this . instance_ , '%s: cannot find the instance' , TAG ) ; devAssert ( ! this . consentChangeHandler_ , '%s: Duplicate consent change handler, will be ignored' , TAG ) ; this . consentChangeHandler_ = handler ; this . getConsentInstanceInfo ( ) . then ( info => { handler ( info ) ; } ) ; }
Register the handler for every consent state change.
Register the handler for every consent state change .
// Fire first consent instance state.