Useful hooks for use with Feathers services.
Some hooks had features which were not initially apparent,
e.g. remove
did not remove when the call was made on the server.
These features have been removed when they were infrequently used,
or, when removal would result in a significant breaking change,
new hooks have been introduced which deprecate the original ones.
Such features can be re-implemented using conditional hooks, with the additional benefit of making what is happening clearer.
Breaking changes:
- All hooks and utilities are obtained from
feathers-hooks-common
rather than some from, say,feathers-hooks-common/promisify
. - Some functions supported a deprecated predicate as their last param. This feature has been removed.
- The populate hook now ignores pagination on joined services by default.
Deprecated:
- The legacy populate hook -- with signature (string, ...) --
will be removed next version. Use the regular
populate
hook. - Use
deleteByDot
rather thansetByDot(obj, path, value, true)
. - The
disallow
hook should be used instead ofdisable
. - The
discard
hook should be used instead ofremove
. You will need to wrapdiscard
in an conditional if you want it to work likeremove
does.
Refer to Feathersjs documentation.
Run npm install feathers-hooks-common --save
in your project folder (installs the latest v2 release).
npm test
to run tests.
MIT. See LICENSE.