How to use the evt.emitWhenListener function in evt

To help you get started, we’ve selected a few evt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla-b2g / gaia / apps / email / js / model.js View on Github external
//      switch to the latest account which user just added.
            var account = showLatest ? acctsSlice.items.slice(-1)[0] :

            this.changeAccount(account, callback);
          } else if (callback) {

          this.inited = true;

          // Once the API/worker has started up and we have received account
          // data, consider the app fully loaded: we have verified full flow
          // of data from front to back.
github mozilla-b2g / gaia-email-libs-and-more / js / worker-support / cronsync-main.js View on Github external
// is only known to the front end, so publish event about it.
      // Need a CPU lock since otherwise the app can be paused
      // mid-function, which could lead to unexpected behavior, and the
      // sync should be completed as quick as possible to then close
      // down the app.
      // TODO: removed wifi wake lock due to network complications, to
      // be addressed in a separate changset.
      if (navigator.requestWakeLock) {
        var locks = [

        debug('wake locks acquired: ' + locks +
              ' for account IDs: ' + data.accountIds);

                             makeAccountKey(data.accountIds), locks);

      debug('alarm dispatch started at ' + (new Date()));

                              [data.accountIds, data.interval]);