Created
April 23, 2020 14:02
-
-
Save NyaGarcia/a5343adaa0eef53b6a0592d416bee84c to your computer and use it in GitHub Desktop.
Creating an Observable with generate()
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
import { generate } from "rxjs"; | |
const number$ = generate( | |
1, | |
x => x < 10, | |
x => x + 1 | |
); | |
number$.subscribe(console.log); | |
// Output: 1, 2, 3, 4, 5, 6, 7, 8, 9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment