Support multiple hooks per action
- Linguagem predominante
- JavaScript
- Estrelas
- 2k
- Forks
- 238
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, nodejs
- Domínio
- backend, databases
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100