search

Home  >  Q&A  >  body text

javascript - How can await be executed repeatedly when compiled with es6 babel?

For example:

(async () => {
    const a = await promise();
    console.log(a);
})()

The promise function can be resolved multiple times. How can the function after await be executed repeatedly?

ringa_leeringa_lee2730 days ago975

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-06-12 09:33:00

    Promise is a single-value push type.
    You can use the Observable of RxJs and you can push multiple values

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-12 09:33:00

    http://blog.csdn.net/hzaini89...

    For reference

    reply
    0
  • Cancelreply