-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apps with many containers #10
Comments
Yeah, that's something I would like to figure out. import { compose } from "unstated-next"
let Provider = compose(ContainerOne, ContainerTwo) However unless React adds an API for I'd also like to experiment with "auto-registering" to make code splitting easier. |
In the regular unstated world, how did it get around this issue? |
Is there something like: <Subscribe to={[AppContainer, CounterContainer, ...]}>
{(app, counter, ...) => (
<Child />
)}
</Subscribe> |
I'm using something like this now, that seems to be working:
|
let app = AppContainer.useContainer()
let counter = CounterContainer.userContainer()
<Child /> |
My hack didn't really work. Instead I modified unstated to use a common Map() instead of per-Provider instance. |
This comment has been minimized.
This comment has been minimized.
I think I'm going to avoid adding something like this for now. I've written at length about why here: #20 (comment) |
What is the recommanded way to do as the issue state "Apps with many containers" ? |
Not maintained? |
You can checkout my idea: react-hook-svs. Highlights:
|
Hello, I am working on project with unstated
components where needs to access to stores
|
I'm trying to get my head around the new approach and there are a few things I'm getting stuck on. Part 1 - if I have 10 containers (as I do in my unstated implementation), do I now have to list every one of them at the top level? I certainly appreciated just being able to wrap my App component in
<Provider><App /></Provider>
and be done with it.The text was updated successfully, but these errors were encountered: