You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+## Cancelling hook chain
+
+If you want certain hooks to be skipped you may set any custom property onto context, then wrap hooks you want to skip
+into iff-hook and check.
+> Note: The aforementioned trick doesn't prevent database call. In this case context.result should be set in before hook.
+
+```js
+const { iff } = require('feathers-hooks-common');
+
+app.service('servicename').hooks({
before: [
context => {
context.cancelled = true;
return context;
},
iff(
context => context.cancelled,
[hookA, hookB] // <- skipped
),
hookC // not skipped
]
+})
+```
The text was updated successfully, but these errors were encountered:
+## Cancelling hook chain
+
+If you want certain hooks to be skipped you may set any custom property onto
context
, then wrap hooks you want to skip+into iff-hook and check.
+> Note: The aforementioned trick doesn't prevent database call. In this case
context.result
should be set in before hook.+
+```js
+const { iff } = require('feathers-hooks-common');
+
+app.service('servicename').hooks({
+})
+```
The text was updated successfully, but these errors were encountered: