How to use ember-lifeline - 8 common examples

To help you get started, we’ve selected a few ember-lifeline 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 nano-wallet-company / nano-wallet-desktop / app / electron / service.js View on Github external
constructor(...args) {
    super(...args);

    if (this.isElectron) {
      // eslint-disable-next-line no-undef
      const { shell, remote, ipcRenderer } = requireNode('electron');
      this.shell = shell;
      this.remote = remote;
      this.ipcRenderer = ipcRenderer;

      addEventListener(this, window, 'beforeunload', () =>
        this.ipcRenderer.send('window-unloading'),
      );

      const onDownloadProgress = ::this.onDownloadProgress;
      const onDownloadVerify = ::this.onDownloadVerify;
      const onDownloadExtract = ::this.onDownloadExtract;
      const onDownloadDone = ::this.onDownloadDone;
      const onNodeExit = ::this.onNodeExit;
      this.registerDisposable(() => {
        ipcRenderer.removeListener('download-progress', onDownloadProgress);
        ipcRenderer.removeListener('download-verify', onDownloadVerify);
        ipcRenderer.removeListener('download-extract', onDownloadExtract);
        ipcRenderer.removeListener('download-done', onDownloadDone);
        ipcRenderer.removeListener('node-exit', onNodeExit);
      });
github ember-lifeline / ember-lifeline / addon-test-support / setup-lifeline-validation.ts View on Github external
hooks.beforeEach(function() {
    _setRegisteredDisposables(registeredDisposables);
  });
github ember-lifeline / ember-lifeline / addon-test-support / setup-lifeline-validation.ts View on Github external
try {
      let retainedObjects: unknown[] = [];
      registeredDisposables.forEach((_, k) =>
        retainedObjects.push(k.toString())
      );

      if (retainedObjects.length > 0) {
        if (test.expected !== null) {
          test.expected += 1;
        }

        assert.deepEqual(retainedObjects, [], FAILED_ASSERTION_MESSAGE);
      }
    } finally {
      _setRegisteredDisposables(new WeakMap());
    }
  });
}
github nano-wallet-company / nano-wallet-desktop / app / components / account-carousel / component.js View on Github external
updateSwiper() {
    const swiperInstance = this.get('swiperInstance');
    if (swiperInstance) {
      runTask(swiperInstance, 'forceUpdate');
    }
  }
github smile-io / ember-polaris / addon / components / polaris-text-field.js View on Github external
handleButtonPress(onChange) {
    let minInterval = 50;
    let decrementBy = 10;
    let interval = 200;

    let onChangeInterval = () => {
      if (interval > minInterval) {
        interval -= decrementBy;
      }

      onChange();

      this.buttonPressTaskId = runTask(this, onChangeInterval, interval);
    };

    this.buttonPressTaskId = runTask(this, onChangeInterval, interval);
  },
github smile-io / ember-polaris / addon / components / polaris-text-field.js View on Github external
handleButtonRelease() {
    cancelTask(this, this.buttonPressTaskId);
  },
github nano-wallet-company / nano-wallet-desktop / app / components / account-carousel / component.js View on Github external
destroySwiper() {
    const swiperInstance = this.get('swiperInstance');
    if (swiperInstance) {
      runDisposables(swiperInstance);
      this.set('swiperInstance', null);
    }
  }
github smile-io / ember-polaris / addon / services / sticky-manager.js View on Github external
handleResize() {
    throttleTask(this, 'manageStickyItems', 50, false);
  },

ember-lifeline

Ember.js addon for lifecycle aware async tasks and DOM events.

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis