Created
September 26, 2016 15:49
-
-
Save focusaurus/4bda0999a9c864d170412c5df43bf5eb 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
function listUsers (req, callback) { | |
// use req as immutable input | |
// standard node error-first callback API | |
// success value of callback is a response-shaped object with properties: statusCode, headers, body | |
} | |
// I haven't built one of these, just riffing. | |
// Look at clojure and other functional languages for examples that might | |
// have reasonable counterparts in "functional-light" JS | |
// Thinking more along the lines of react/redux reducer style | |
// Problems with express: | |
// - the res object being so stateful, harder to test | |
// - middleware dependencies are implicit instead of explicit | |
// - "next" connect middleware API is not just standard error-first callback pattern |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment