Skip to content

Conversation

@paulbakker
Copy link
Contributor

This compose function makes it possible to create a handler chain, without the need to export Chain publicly. This will be used to implement hot-reloading in the enroute project.
Discussed the idea in person with @hekike.

@@ -0,0 +1,23 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this under a utils and export it like module.exports.utils = require('./utils');.
Would you mind adding a unit test?

@hekike hekike requested a review from DonutEspresso May 15, 2018 16:42
@hekike
Copy link
Contributor

hekike commented May 15, 2018

@DonutEspresso what do you think? should we export it under a namespace like utils, helpers etc? What would be the best naming?

@DonutEspresso
Copy link
Member

Either is fine - I don't feel too strongly about it. Let's go with helpers.compose? Since the name "Chain" has no meaning outside of restify, I think keeping the exported name generic is probably good. We can keep the file name composeChain.

@paulbakker
Copy link
Contributor Author

@hekike Moved/renamed the export and added tests. I can squash if this looks ok.

@hekike
Copy link
Contributor

hekike commented May 15, 2018

@paulbakker okay thanks, one small thing: please just call it helpers.compose, see Alex's reasoning.

…to export Chain

added exported function to compose a handler chain, wihtout the need to export Chain

moved chainComposer to helpers

added tests for chaincomposer

renamed compose export
@paulbakker
Copy link
Contributor Author

@hekike renamed to helpers.compose and squashed commits.

@hekike hekike merged commit eb60ef4 into restify:master May 16, 2018
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.

3 participants