Last active
January 27, 2018 10:41
-
-
Save rudyhuynh/ec1060dce6a7fa504bb1d790e1d044ed 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
import flowRight from 'lodash.flowright' | |
import {onErrorRetryHOF} from './onErrorRetryHOF' | |
import {bypassCacheHOF} from './bypassCacheHOF' | |
export const myAppFetch = flowRight([ | |
onErrorRetryHOF, | |
bypassCacheHOF, | |
// more higher-order fetch here | |
])(fetch) // <--- the original fetch | |
// usage (just like original fetch): | |
myAppFetch('https://my.api').then(/* ... */) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment