Skip to content

Instantly share code, notes, and snippets.

@couzic
Last active April 7, 2017 21:50
Show Gist options
  • Select an option

  • Save couzic/0688864edb64d9990f098bf2b25b8e8c to your computer and use it in GitHub Desktop.

Select an option

Save couzic/0688864edb64d9990f098bf2b25b8e8c to your computer and use it in GitHub Desktop.
Temporal Transparency - Simple Example
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