microsoft / redux-micro-frontend

This is a library for using Redux to manage state for self-contained apps in a Micro-Frontend architecture. Each self-contained isolated app can have its own isolated and decoupled Redux store. The componentized stores interact with a global store for enabling cross-application communication.
MIT License
344 stars 64 forks source link

queued subscribe callbacks for missing stores #17

Closed rotty3000 closed 2 years ago

rotty3000 commented 3 years ago

Is your feature request related to a problem? Please describe. I get an error when subscribing to a missing store.

Describe the solution you'd like Instead of getting an error when subscribing to a missing store, I'd rather the callback be queued up for the possible eventual arrival of the store (maybe never). Meanwhile, the unsubscribe would pull the callback out of the queue if no store ever arrived. Of course if the store did eventually arrive the queued callback should be pulled out of the queue, applied to the store.

Describe alternatives you've considered Not sure of any alternatives.

patrickCode commented 3 years ago

This is a really interesting use case! Let me think of this this a little bit and get back to you with a solution.

rotty3000 commented 3 years ago

Maybe this is just a new subscribe method leaving the other with current behavior?

patrickCode commented 2 years ago

This feature has been added in v1.2.0