Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created April 23, 2020 14:02
Show Gist options
  • Save NyaGarcia/a5343adaa0eef53b6a0592d416bee84c to your computer and use it in GitHub Desktop.
Save NyaGarcia/a5343adaa0eef53b6a0592d416bee84c to your computer and use it in GitHub Desktop.
Creating an Observable with generate()
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