Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Rename async hooks to around hooks, allow usual registration format #2652

Merged
merged 5 commits into from
Jun 6, 2022

Conversation

daffl
Copy link
Member

@daffl daffl commented Jun 1, 2022

This pull request renames the new "async" @featherjs/hooks to "around" hooks since it is much more descriptive and in line with the Common LISP terminology for essentially the same thing. It also adds them as a new type to the registration format we are already using and updates the hook handling to use the new collect functionality from @feathersjs/hooks:

app.service('myservice').hooks({
  around: {
    all: [],
    get: [],
    myCustomMethod: []
  },
  before: {
    all: [],
    get: []
  },
  after: {},
  error: {}
})

This should allow for a smooth transition of introducing a new hook type.

@daffl daffl changed the title feat(core): Rename async hooks to around hooks and allow usual registration format feat(core): Rename async hooks to around hooks, allow usual registration format and use new hooks collect utility Jun 4, 2022
@daffl daffl changed the title feat(core): Rename async hooks to around hooks, allow usual registration format and use new hooks collect utility feat(core): Rename async hooks to around hooks, allow usual registration format Jun 4, 2022
@daffl daffl merged commit 2a485a0 into dove Jun 6, 2022
@daffl daffl deleted the around-hooks branch June 6, 2022 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant