Last active
April 7, 2017 21:50
-
-
Save couzic/0688864edb64d9990f098bf2b25b8e8c to your computer and use it in GitHub Desktop.
Temporal Transparency - Simple Example
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 {BehaviorSubject, Observable} from 'rxjs' | |
| let count = 0 | |
| const count$ = new BehaviorSubject(count) | |
| export const counter = { | |
| increment() { | |
| ++count | |
| count$.next(count) | |
| } | |
| getCount(): Observable<number> { | |
| return count$ | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment