Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Multiple stores don't work #14

Open
kraftwer1 opened this issue Jan 29, 2019 · 2 comments
Open

Multiple stores don't work #14

kraftwer1 opened this issue Jan 29, 2019 · 2 comments

Comments

@kraftwer1
Copy link

The way stencil-redux is implemented today allows only one store. Which makes totally sense for a single page application and is also the recommended approach by Redux itself.
However, when using Stencil to build a component library, where components can be consumed independently from each other, all of them need their own store (since they are an app themselves).

@Sanderand
Copy link

Sanderand commented Mar 19, 2020

We're running into the same problem. Is anybody working on a fix for this? The only alternative that could possibly work is to implement custom store integrations for our stencil projects.

@stanley85
Copy link

I am not sure if having different stores could help me with my current need to split ui states on a per datasheet base. What is described may solve the issue I have, but reading its not working atm like this surely gets my +1 to fix this.

Can anyone help me on my usecase, I am a little stuck in the logic:
I have my ui state inside the store and am loading different page data from google firebase. My current ui state is initializied by analyzing the datasheet on componentWillLoad() and then setting it inside the store if there are no values in the store present. How can I store the viewState on a datasheet hash based model? Is there an option to work with typescript maps inside of redux? Maybe I am just missing the point on how to keep the state based on the route without changing each viewState member to work as an named array ...

My viewstate is an object with 3 subkeys basically a collection of 3 lists of booleans controlling the options toggled inside each of the datasheets. The list of options for the viewContainers is dynamically for example I have a list of booleans for the state of an undefined number of accordions. If i change the route to another datasheet the store keeps the state alive but this should be based on the key of the datasheet. Eg my second accordion should persist its open state only in the data hash its been opened ...

Thanks in advance, i did not find any solution on this, maybe its that simple and I am thinking to complicated - I cannot find a working syntax on returning the state when having viewState as an Array inside the store :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants