Created
April 30, 2018 16:26
-
-
Save vivainio/2283d073d0a17fac58f83dd20fe31ff2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
getPostAndAuthorData = createTransformer((postId: string) => { | |
const post = this.getPost(postId); | |
if (!post) return undefined; | |
const author = this.getAuthor(post.authorId); | |
if (!author) return undefined; | |
return { | |
post, | |
author | |
} | |
}); | |
// in component autorun | |
this.content = this.postService.getPostAndAuthorData(postId) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment