Support multiple hooks per action
- Langage dominant
- JavaScript
- Étoiles
- 2k
- Forks
- 238
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
It should be possible to add multiple hooks per action. Also let's get rid of mixin-style hooks declaration. Hook should return promise.
```
User.afterCreate = function(data, done) {
Basket.create({userId: this.id}, (err, basket) => {
done(err);
});
};
```
should become
```
User.hooks.after('create', user => Basket.create({userId: user.id}));
```
Old mixin-style should be deprecated from next stable version.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Look at the ORM's hook system, likely in a hooks or lifecycle module. Understand how hooks are currently attached (mixin-style) and the data flow. The change involves designing a new API for multiple promises per action and deprecating the old style. Check existing tests for hooks to understand the expected behavior.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, nodejs
- Domaine
- backend, databases
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100