-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Looking into a way to extend the implementation for custom stores, specifically to inject custom middlewares it seems like at the moment this is not possible.
I think this is really helpful mechanism for us (as developers) to decrease complexity from store into middleware or stuff like async actions, as having selctors and resolvers does not fill all scenarios to handle REST actions.
I was looking at #692 however that one is related to the store used internally not for the ones created by third party.
Describe the solution you'd like
I think by adding a new parameter to this function: registerStore as an array for custom enhancers and for registerReducer so this can be set directly when the store is created.
- https://github.com/WordPress/gutenberg/blob/master/packages/data/src/index.js#L49
As at the moment the stores only have a single enhancer which is the one used to debug (which is great BTW).
But I think having the opportunity to add custom enhancers here would be great.
Describe alternatives you've considered
Happy to collaborate with a PR for this in order to allow the extension of custom stores as well.
Just wanted to drop the ideas in an issue before moving ahead with that.
Please let me know your thoughts on that one.
Thank you!