了解 FeathersJS 钩子
Understanding FeathersJS hooks
我正在关注 the tutorial。在 Asynchronous hooks
中,有这样一个片段:
todoService.before({
find(hook) {
return this.find().then(data => {
hook.params.message = 'Ran through promise hook';
hook.data.result = data;
// Always return the hook object
return hook;
});
}
});
你能告诉我 this.find()
应该做什么吗?
find
是 Feathers service method and this
is the service the hook is running on.
我正在关注 the tutorial。在 Asynchronous hooks
中,有这样一个片段:
todoService.before({
find(hook) {
return this.find().then(data => {
hook.params.message = 'Ran through promise hook';
hook.data.result = data;
// Always return the hook object
return hook;
});
}
});
你能告诉我 this.find()
应该做什么吗?
find
是 Feathers service method and this
is the service the hook is running on.