Created
December 7, 2016 06:14
-
-
Save mdboop/15a0fda919bd8634f529357675448935 to your computer and use it in GitHub Desktop.
This file contains 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
function epic(action$) { | |
return Observable.ofType('FETCH_FOO') | |
.mergeMap(() => | |
ajax('/api/foos') | |
.map((data) => ({ | |
type: 'FETCH_FOO_SUCCESS', | |
data, | |
})) | |
.catch((err) => [{ | |
type: 'FETCH_FOO_ERROR', | |
err, | |
}])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment