Package Exports
- feathers-hooks-common
- feathers-hooks-common/lib/index
- feathers-hooks-common/lib/services
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (feathers-hooks-common) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
feathers-hooks-common
Useful hooks for use with Feathers services.
Migration to v3 from v2
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.
Documentation
Refer to Feathersjs documentation.
Installation
Run npm install feathers-hooks-common --save
in your project folder (installs the latest v2 release).
Tests
npm test
to run tests.
License
MIT. See LICENSE.