aweary / react-copy-write

✍️ Immutable state with a mutable API
MIT License
1.79k stars 54 forks source link

Ideas for middleware. #17

Open pksjce opened 6 years ago

pksjce commented 6 years ago

Kudos to you for making this lib! I'm loving the mutating abilities. I want to talk about having some middleware like abilities or hooks to the update function to implement common functionality among all mutations. Two use cases that I wanted particularly were

  1. Logger/debug tool
  2. Crash reporter.

Did you have any plans of supporting such a thing? Would you be interested in a PR if I worked on it?

aweary commented 6 years ago

I'm am definitely in favor of supporting middleware! Thanks for opening this issue, and a PR. I'll review it as soon as I can.

pksjce commented 6 years ago

Cool! The PR is pretty raw. You may or may not approve of the approach. I will polish it up after your feedback.