Understanding FeathersJS hooks

最后都变了- 提交于 2020-01-06 23:46:10

问题


I'm following the tutorial. In Asynchronous hooks, there's a snippet like this:

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;
    });
  }
});

Would you please let me know what this.find() is supposed to do?


回答1:


find is a Feathers service method and this is the service the hook is running on.



来源:https://stackoverflow.com/questions/37152839/understanding-feathersjs-hooks

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!