Flow: yield* an iterable in an async generator function

Created on 10 Dec 2017  路  2Comments  路  Source: facebook/flow

async function* fn() {
  yield* [1,2]
}

Flow reports that [1, 2] is not an AsyncIterable
https://flow.org/try/#0IYZwngdgxgBAZgV2gFwJYHsICp4QBQCUMA3gFAwxioCmANgCY4DaAjADQBMAuqQL6lA

bug generators iterators

Most helpful comment

That's different. My code is the equivalent of

async function* fn() {
  yield 1;
  yield 2;
}

All 2 comments

use

async function* fn() {
  yield [1,2]
}

That's different. My code is the equivalent of

async function* fn() {
  yield 1;
  yield 2;
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

philikon picture philikon  路  3Comments

davidpelaez picture davidpelaez  路  3Comments

Beingbook picture Beingbook  路  3Comments

cubika picture cubika  路  3Comments

funtaps picture funtaps  路  3Comments