Skip to content

Instantly share code, notes, and snippets.

@vivainio
Last active April 30, 2018 16:58
Show Gist options
  • Save vivainio/35749c7e33796fb81e80edcde5633861 to your computer and use it in GitHub Desktop.
Save vivainio/35749c7e33796fb81e80edcde5633861 to your computer and use it in GitHub Desktop.
class PostsReaderComponent {
ngOnInit() {
const disposer = startObservers(null, "PostsReader.", [
[
"Loading",
() => {
this.loading = this.postsService.getPost(this.docId) != null
}
],
[
"Data",
() => {
this.postData = this.postService.getPostAndAuthor(this.docId)
}
]
]);
addComponentDisposer(this, disposer);
}
ngOnDestroy() {
stopObserving(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment