You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't see any major reason not to remove support as the rest of the Sequelize API uses promises. But, on the other hand, I don't see a major advantage to removing them. Promisifying a callback-based hook function only happens once when the hook is created and after that there is no performance cost.
I only use promises myself, so it doesn't affect me anyway!
Nothing is set in stone yet, however i don't see much point in keeping code around that we don't advertise. And i don't see why we would have one part of the API support callbacks when the rest doesn't, that just seems odd. Would also allow us to remove the current callback guessing code.
But to be clear, no hooks will be disappearing. Just that writing hooks as a function which then calls a callback to finish will no longer be supported - your hook functions just have to return a promise.
Activity
overlookmotel commentedon Jan 17, 2016
I don't see any major reason not to remove support as the rest of the Sequelize API uses promises. But, on the other hand, I don't see a major advantage to removing them. Promisifying a callback-based hook function only happens once when the hook is created and after that there is no performance cost.
I only use promises myself, so it doesn't affect me anyway!
mickhansen commentedon Jan 17, 2016
Nothing is set in stone yet, however i don't see much point in keeping code around that we don't advertise. And i don't see why we would have one part of the API support callbacks when the rest doesn't, that just seems odd. Would also allow us to remove the current callback guessing code.
manchicken commentedon May 23, 2016
Would this include things like model hooks?
overlookmotel commentedon May 24, 2016
@manchicken Yes, this would apply to all hooks.
But to be clear, no hooks will be disappearing. Just that writing hooks as a function which then calls a callback to finish will no longer be supported - your hook functions just have to return a promise.
felixfbecker commentedon May 28, 2016
This happened in #5924
janmeier commentedon May 30, 2016
Cool, I'll ammend the changelog then :)
mickhansen commentedon May 30, 2016
I'd like to double check this and verify we have tests for non-bluebird promises aswell as ensuring that the code is cleaned up as much as possible.
chore(hooks): remove callback support, closes #5228