Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const composeCPS = (f, g) => {
- return (x, cb) => {
- g(x, y => {
- f(y, z => {
- cb(z)
- })
- })
- }
- }
- // Then it can compose again
- const readFileContentCPS = composeCPS(readFileCPS, readFileCPS)
- readFileContentCPS('./file1', result => console.log(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement