Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor `read` API to have a fixed signature. #31

Closed
totherik opened this issue Aug 14, 2014 · 0 comments
Closed

Refactor `read` API to have a fixed signature. #31

totherik opened this issue Aug 14, 2014 · 0 comments
Assignees
Milestone

Comments

@totherik
Copy link
Contributor

@totherik totherik commented Aug 14, 2014

Per #28:

We don't support dynamic APIs for runtime functions.

The read API breaks this convention by allowing any combination of optional options, and callback arguments, e.g. read(req, [options], [callback]);. As a performance optimization the signature should always be additive, requiring arguments to be provided for each position: read(req, [options [, callback]]);

For example, to omit the options argument in read, one should:

Nipple.read(req, null, function (err, payload)) {
 //...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.