Last active
November 29, 2018 05:08
-
-
Save caroso1222/909e8440db40de9617f2e4341645b0b6 to your computer and use it in GitHub Desktop.
rxjs-pausify-example
This file contains 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
// THIS PACKAGE DOES NOT EXIST! IT'S ONLY FOR THE DEMO! | |
import { PauseableObservable, pausify } from 'rxjs-pausify'; | |
export class MyClass { | |
pausable$: PauseableObservable<number>; | |
constructor() { | |
this.pausable$ = pausify(interval(500)); | |
this.pausable$.subscribe(console.log); | |
} | |
pause() { | |
this.pausable$.pause(); | |
} | |
resume() { | |
this.pausable$.resume(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment