Add note about unavailable args to remote hooks.

This commit is contained in:
Rand McKinney 2014-06-03 15:22:08 -07:00
parent 78d1e3b966
commit 61fc2d7158
1 changed files with 4 additions and 1 deletions

View File

@ -122,7 +122,8 @@ as follows (assuming `name` as the name of the input parameter to resolve):
### Remote hooks
Run a function before or after a remote method is called by a client.
A _remote hook_ enables you to execute a function before or after a remote method is called by a client.
The `beforeRemote` function runs before the remote method and `afterRemote` runs after.
```js
// *.save === prototype.save
@ -139,6 +140,8 @@ User.afterRemote('*.save', function(ctx, user, next) {
next();
});
```
***NOTE***: The second argument to the hook(`user` in the above example) is the `ctx.result` which is not always available.
Remote hooks also support wildcards. Run a function before any remote method is called.