Created
August 18, 2016 15:45
-
-
Save hnry/e5b7a7ab2da45599e19497c6288db8cc 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
const final_handler = (request) => { | |
return "hi!" | |
} | |
const a = (handler) => { // handler is `b` | |
return async (request) => { | |
return handler(request) | |
} | |
} | |
const b = (handler) => { // handler is `final_handler` | |
return async (request) => { | |
return handler(request) | |
} | |
} | |
(final_handler, [a, b]) // a gets called first, passing b as it's handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment