SHARE
TWEET

Untitled

a guest Feb 16th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. `@State<PostStateModel>({
  2.     name: 'posts',
  3.     defaults: {
  4.         posts: [],
  5.         request: {
  6.           loading: false,
  7.           error: null,
  8.         }
  9.     }
  10. })
  11.  
  12. export class PostState{    
  13.     constructor(private postService: PostService) {}`
  14.  
  15. @Selector()
  16. static posts(state: PostStateModel){
  17.     return state.posts;
  18. };
  19. static request(type: string){
  20.   return createSelector([PostState], (state: PostStateModel) => {
  21.     console.log(type);
  22.     console.log(state.request[type])
  23.     return state.request[type];
  24.   })
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top