Last active
July 8, 2018 13:59
-
-
Save xthecapx/19b0103b07f5bc795e54e8368caf595d to your computer and use it in GitHub Desktop.
Service 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
export class Databus { | |
// Creating the state data | |
private data: Subject<state> = new Subject(); | |
// Creating the databus | |
data$ = data.asObservable(); | |
// | |
public changeData() { | |
// Edit the data | |
//Inform about changes through the Observable | |
this.data.next(data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment