Created
July 5, 2018 06:43
-
-
Save Shuumatsu/f7b783348e21604b5c86b418c5d63094 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const sync = syncFn => (data, cb) => data |> syncFn |> cb; | |
export const compose = (taskList, cb) => | |
reduceRight((next, task) => data => task(data, next), cb, taskList); | |
export const withErrorHandler = handler => | |
map(task => (data, next) => | |
data instanceof Error ? handler(data) : task(data, next) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment