Skip to content

Instantly share code, notes, and snippets.

@xthecapx
Last active July 8, 2018 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xthecapx/19b0103b07f5bc795e54e8368caf595d to your computer and use it in GitHub Desktop.
Save xthecapx/19b0103b07f5bc795e54e8368caf595d to your computer and use it in GitHub Desktop.
Service Example
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