Created
July 29, 2019 17:39
-
-
Save Pengeszikra/860ab3c11ef10d690f3f031dc5c3cb7f to your computer and use it in GitHub Desktop.
custom railway oriented programming core in javascript
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
export const railway = (semaphore = () => false) => (begin, ...calls) => | |
calls.reduce( | |
(value, call) => semaphore(value) ? value : call(value) | |
, begin) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment