Remove providers and executors
Pre-release
Pre-release
Removing providers
Both the providers and the executors have been removed in the favor of object based hooks. Object based hooks can serve both the use cases.
The providers were tracked separately from the hooks and therefore their order of execution will always be at the last or the first. It can be mixed with hooks. For example:
hooks.add('saving', () => {
console.log('first')
})
class SomeProvider {
saving() {
console.log('saving')
}
}
hooks.provider(SomeProvider)
hooks.add('saving', () => {
console.log('third')
})The execution output will be
first
third
secondThis can be problematic in some edge case scenarios and we want to guarantee the order of execution to be same as the order of defining hooks or providers. Therefore, the providers have been removed
Removing executors
Custom executors were meant to customize how a hook handler should be called. The same can be achieved using object based hooks and wrapping the original hook handler.
Commits
- refactor: remove providers and executor in favor of object based hooks b756e70