Pausable RxJs Streams

So, I made this extremely simple web timer for my own personal use. You can check it out at https://obscure-temple-46876.herokuapp.com/ and the code for it at https://github.com/NerdcoreSteve/SimpleWebTimer.

I've already written a blog post about how it works generally, but I wanted to make an additional post about how I pause and un-pause the RxJs timer I use.

(Pssst! I blog about RxJs here: http://funkyjavascript.com/rxjs/)

Here's how I created the timer:

timer = Rx  
    .Observable
    .interval(1000)
    .pausable(new Rx.Subject())

Before you ask, I don't know why you have to give .pausable a new Rx.Subject(), you just do :P

So now all I have to do to to pause is to simply call timer.pause and to resume I can call timer.resume. Pretty simple right?

Happy coding! :)

Looking for a software developer?