Skip to content

Files

Latest commit

 

History

History
25 lines (18 loc) · 410 Bytes

await_only_futures.md

File metadata and controls

25 lines (18 loc) · 410 Bytes

Pattern: Use of await for non-Future

Issue: -

Description

AVOID using await on anything other than a future.

Example of incorrect code:

main() async {
 print(await 23);
}

Example of correct code:

main() async {
 print(await Future.value(23));
}

Further Reading