How to use the ember-concurrency.waitForEvent function in ember-concurrency

To help you get started, we’ve selected a few ember-concurrency 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 machty / ember-concurrency / tests / dummy / app / components / events-example / component.js View on Github external
waiter: task(function * () {
    let event = yield waitForEvent(document.body, 'click');
    return event;
  }),
// END-SNIPPET
github machty / ember-concurrency / tests / dummy / app / components / events-example / component.js View on Github external
emberEventedLoop: task(function * () {
    while(true) {
      let event = yield waitForEvent(this, 'fooEvent');
      this.set('emberEvent', event);
    }
  }).on('didInsertElement'),
// END-SNIPPET
github hashicorp / vault / ui / app / components / auth-jwt.js View on Github external
prepareForOIDC: task(function*(oidcWindow) {
    // show the loading animation in the parent
    this.onLoading(true);
    // start watching the popup window and the current one
    this.watchPopup.perform(oidcWindow);
    this.watchCurrent.perform(oidcWindow);
    // and then wait for storage event to be fired from the popup
    // window setting a value in localStorage when the callback route is loaded
    let storageEvent = yield waitForEvent(this.getWindow(), 'storage');
    this.exchangeOIDC.perform(storageEvent, oidcWindow);
  }),
github machty / ember-concurrency / tests / dummy / app / components / events-example / component.js View on Github external
jQueryEventLoop: task(function * () {
    let $body = $('body');
    while(true) {
      let event = yield waitForEvent($body, 'click');
      this.set('jQueryEvent', event);
    }
  }).on('didInsertElement'),
github hashicorp / nomad / ui / app / components / two-step-button.js View on Github external
@task(function*() {
    while (true) {
      let ev = yield waitForEvent(document.body, 'click');
      if (!this.element.contains(ev.target) && !this.awaitingConfirmation) {
        this.send('setToIdle');
      }
    }
  })
  cancelOnClickOutside;
github hashicorp / vault / ui / app / components / http-requests-bar-chart-simple.js View on Github external
waitForResize: task(function*() {
    while (true) {
      yield waitForEvent(window, 'resize');
      run.scheduleOnce('afterRender', this, 'updateDimensions');
    }
  })
    .on('didInsertElement')
github hashicorp / vault / ui / app / components / transit-edit.js View on Github external
waitForKeyUp: task(function*() {
    while (true) {
      let event = yield waitForEvent(document.body, 'keyup');
      this.onEscape(event);
    }
  })
    .on('didInsertElement')
github mozilla / sops / vendor / github.com / hashicorp / vault / ui / app / components / http-requests-bar-chart.js View on Github external
waitForResize: task(function*() {
    while (true) {
      yield waitForEvent(window, 'resize');
      run.scheduleOnce('afterRender', this, 'updateDimensions');
    }
  })
    .on('didInsertElement')
github hashicorp / vault / ui / app / components / auth-jwt.js View on Github external
watchCurrent: task(function*(oidcWindow) {
    yield waitForEvent(this.getWindow(), 'beforeunload');
    oidcWindow.close();
  }),
github hashicorp / levant / vendor / github.com / hashicorp / nomad / ui / app / components / two-step-button.js View on Github external
cancelOnClickOutside: task(function*() {
    while (true) {
      let ev = yield waitForEvent(document.body, 'click');
      if (!this.element.contains(ev.target) && !this.awaitingConfirmation) {
        this.send('setToIdle');
      }
    }
  }),