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

Callback last argument #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Callback last argument #123

wants to merge 2 commits into from

Conversation

NaridaL
Copy link
Collaborator

@NaridaL NaridaL commented Feb 8, 2020

for deserialize and update

fixes #77

I'm not loving this, tbh... you always need to pass the custom arguments now. If you forget them, you won't get a compiler error, as callback is optional, and customArg is typed as any.

Converting to promises completely, as @alexggordon suggested in #77 is problematic too, as Promises always return asynchronously, and the fact that serializr returns synchronously if there are no async dependencies is great.

util.promisify offers a mechanism for a custom promisified function, by defining deserialize[util.promisify.custom] = function..., this would be a non-breaking change which would probably be better. TypeScript also correctly types the custom promisied function.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 88.889% when pulling a1afa26 on callback-last-argument into 3738fe1 on master.

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.

Make "deserialize" promisifiable
2 participants