November 2017
— Use on existing server to create a request counter
The "pro" here is that it avoids mutating stateThe con is that this STILL isn't a pure functional monadic interface
— For two reasons:.once is a side effect (mutates internal state of the event emitter)res.end is not wrapped in a monadic type (like a promise)
Message permanent page
— Is once an actual js function
— I can't find the MDN reference
— No
— Part of nodejs
— But browsers have the equivalent I believe
— Give me a sec
— Well, almost
— Https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
— You'd have to pass the once: true property in the options argument
once: true