Understanding FeathersJS hooks

2019-09-10 08:07发布

问题:

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.



标签: feathersjs