Created
March 21, 2021 06:17
-
-
Save devjaime/850ff1e403239990da0cc81b501b71a1 to your computer and use it in GitHub Desktop.
La clase Stream también viene con algunos constructores útiles. Éstos son los más comunes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Stream.fromIterable([1, 2, 3]); | |
| Stream.value(10); | |
| Stream.empty(); | |
| Stream.error(Exception('ups! algo salio mal')); | |
| Stream.fromFuture(Future.delayed(Duration(seconds: 1), () => 42)); | |
| Stream.periodic(Duration(seconds: 1), (index) => index); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment