#Comprehensive Introduction to @ngrx/store By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
#Comprehensive Introduction to @ngrx/store By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
'use strict'; | |
// The purpose of this example is to show | |
// how you can block the event loop with JavaScript. | |
// There is 3 routes | |
// / respond with Hello, World text | |
// /block uses JavaScript while for 5 seconds | |
// /non-block uses setTimeout for 5 seconds | |
// Do the following |
// Nothing changed here, works as previously. | |
@Effect() actionX$ = this.updates$ | |
.ofType('ACTION_X') | |
.map(toPayload) | |
.switchMap(payload => this.api.callApiX(payload) | |
.map(data => ({type: 'ACTION_X_SUCCESS', payload: data})) | |
.catch(err => Observable.of({type: 'ACTION_X_FAIL', payload: err})) | |
); | |