Skip to content

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

3 participants