Skip to content

Instantly share code, notes, and snippets.

@hnry
Created August 18, 2016 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnry/e5b7a7ab2da45599e19497c6288db8cc to your computer and use it in GitHub Desktop.
Save hnry/e5b7a7ab2da45599e19497c6288db8cc to your computer and use it in GitHub Desktop.
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