SHARE
TWEET

Recures - Effects

a guest Sep 17th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const userManagementReducer = createReducer(
  2.   initialState,
  3.   on(UserManagementActions.getUsersList, state => ({...state})),
  4.   on(UserManagementActions.usersListLoaded, (state, { payload }) => ({...state, usersList: payload}))
  5. );
  6.  
  7. ........
  8.  
  9. @Effect()
  10. getUsersList$: Observable<any> = this.actions$
  11.     .pipe(
  12.       ofType(userManagementActions.getUsersList.type),
  13.       mergeMap(() => this.userManagementService.getUsersList()
  14.         .pipe(
  15.           map(users => (userManagementActions.usersListLoaded({payload: users})))
  16.         )
  17.       )
  18.     );
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