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

Consider adding lifecycle events #133

Open
nandi95 opened this issue Oct 27, 2021 · 0 comments
Open

Consider adding lifecycle events #133

nandi95 opened this issue Oct 27, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@nandi95
Copy link
Collaborator

nandi95 commented Oct 27, 2021

Search terms
events
emit
lifecycle

Describe the solution you'd like
Lifecycle events can be added such as saving, saved, replicating, deleting etc to the package.

Describe how this would benefit the project/others
This would add an additional way to interact with the flow of the model logic.

Note: this will cause the event emitter to not to be tree shakeable as it's always included

Ideas:

  • The listeners could return a boolean and if false the original logic stops e.g.: deleting hook returns false, no request will be made and and any further logic in the delete() method bot executed
  • The hooks are free to change the passed in argument as it's passed by reference.

Describe alternatives you've considered
None

This feature depends on #23

@nandi95 nandi95 added the enhancement New feature or request label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant