Skip to content

Instantly share code, notes, and snippets.

@vmasek
Created February 19, 2018 15:12
Show Gist options
  • Save vmasek/615c906f6621f2408bf97bbe89e52dd4 to your computer and use it in GitHub Desktop.
Save vmasek/615c906f6621f2408bf97bbe89e52dd4 to your computer and use it in GitHub Desktop.
example service
@Injectable()
export class ProductsService {
private readonly stuff$ = new ReplaySubject<Stuff[]>();
readonly stuff = this.stuff$.asObservable();
constructor(private readonly fire: Fire) {
this.fire.getTheStuff().subscribe(
(stuff) => this.stuff$.next(stuff)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment