Skip to content

Combining multiple middleware with compose #21

@bertho-zero

Description

@bertho-zero

This part is not documented on @feathersjs/hooks: https://github.com/koajs/koa/blob/master/docs/guide.md#combining-multiple-middleware-with-koa-compose

const { hooks, compose } = require('@feathersjs/hooks');

hooks(Hello, {
  sayHi: [
    compose([
      logRuntime,
      validateName,
      compose([
        /* ... */
      ])
    ])
  ]
});

Try it: https://runkit.com/embed/l7srsn9s0s2q

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions