How to use the ember-concurrency.hash 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 nano-wallet-company / nano-wallet-desktop / app / wallets / overview / accounts / history / route.js View on Github external
async model() {
    const wallet = this.modelFor('wallets');
    const account = this.modelFor('wallets.overview.accounts');
    const history = await this.store.query('history', {
      account: get(account, 'id'),
      count: 100,
    });

    return hash({
      wallet,
      account,
      history,
    });
  }
github dknutsen / ember-needs-async / addon / helpers / async-hash.js View on Github external
asyncHashTask: task(function * (tasks) {
    return yield hash(tasks);
  }),
  compute([tasks/*, ...rest*/]/*, hash*/) {
github nano-wallet-company / nano-wallet-desktop / app / wallets / overview / settings / route.js View on Github external
model() {
    const wallet = this.modelFor('wallets/overview');
    const seed = this.get('rpc').walletSeed(get(wallet, 'id'));
    return hash({
      wallet,
      seed,
    });
  }
github nano-wallet-company / nano-wallet-desktop / app / wallet / adapter.js View on Github external
async findRecord(store, type, id, snapshot) {
    const rpc = this.get('rpc');
    const { wallet } = this.serialize(snapshot, { includeId: true });
    const { representative, accounts } = await hash({
      representative: rpc.walletRepresentative(wallet),
      accounts: rpc.accountList(wallet),
    });

    return { wallet, representative, accounts };
  }
github nano-wallet-company / nano-wallet-desktop / app / setup / backup / route.js View on Github external
model() {
    const wallet = this.modelFor('setup').save();
    const seed = generateSeed();
    return hash({
      wallet,
      seed,
    });
  }
github nano-wallet-company / nano-wallet-desktop / app / status / service.js View on Github external
return this.runTask(() => {
      const rpc = this.get('rpc');
      const blocks = rpc.blockCount();
      const peers = rpc.peers().then(p => Object.keys(p));
      const promise = hash({
        blocks,
        peers,
      });

      set(this, 'promise', promise);
      return this.runTask(next, STATUS_POLL_INTERVAL);
    });
  }