framework icon indicating copy to clipboard operation
framework copied to clipboard

Consider adding lifecycle events

Open nandi95 opened this issue 2 years ago • 0 comments

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 avatar Oct 27 '21 08:10 nandi95