Skip to content

Return the changed server#8

Closed
pimterry wants to merge 1 commit into
isaacs:masterfrom
pimterry:master
Closed

Return the changed server#8
pimterry wants to merge 1 commit into
isaacs:masterfrom
pimterry:master

Conversation

@pimterry
Copy link
Copy Markdown

Tiny change to the API to return the server after adding destroy() to it.

This gives you a marginally more functional API, which can be nice (server = enableDestroy(http.createServer(...))), but also notably makes it easier to manage the types in TypeScript. You can't directly represent side-effects in most type systems, but you can definitely represent return values.

@pimterry
Copy link
Copy Markdown
Author

Closing, I've just seen that #1 has already implemented this. Consider this another vote to merge that PR!

@pimterry pimterry closed this Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant