Skip to content

Instantly share code, notes, and snippets.

@Odonno
Created May 4, 2020 19:03
Show Gist options
  • Save Odonno/0e75137b3e7ed3dafeffd399dd14144f to your computer and use it in GitHub Desktop.
Save Odonno/0e75137b3e7ed3dafeffd399dd14144f to your computer and use it in GitHub Desktop.
sendStream.ts
const count$ = combineLatest(increment$, decrement$).pipe(
scan((acc, curr) => acc + curr, 0),
startWith(0)
); // basic counter with increment and decrement features
// send realtime event
sendStream("setCount", count$);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment