Get store by id
See original GitHub issueI have one doubt can we get the zustand store by id?
Like we access the store using any id.
Explanation:
I want to create a store per component
Let’s say I used a store inside the <Button />
component I’m using the button component many times and the store should create many times also should not share one store for all components.
I want to use the first <Button />
store in the second and vice versa using the Id.
I can use context but the problem is I cannot access the store outside the <Button />
component.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Get Store ID by store code Magento 2
From where you would like to get the store ID: ... You may need to get a current Store ID, Store Code, Name,...
Read more >Get Store code by Store id programmatically magento 2.
You can get Store code by Store id programmatically using Magento 2. Many times, you have Store id available but you have to...
Read more >Magento 2 Get Current Store ID, Code, Name, Website ID, URL
Sometimes, during Magento 2 customization you need to get the store Information programmatically. You may need to get a current Store ID, Store...
Read more >How To Get Current Store ID In Magento 2 - Meetanshi
You can get store ID by calling the block function in your phtml file. ... $objectManager = \Magento\Framework\App\ObjectManager::getInstance();.
Read more >Magento 2 Get Store ID, Code, Name, infomation in phtml
This article will guide you through how to collect all information of your Magento 2 store including store ID, store name, store URL,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There’s no technical drawbacks. It’s not flux-like, so usage drawbacks? Often people complain there’s no way to dispatch an action to multiple stores. It’s true because zustand is not designed so. So, the single store use case is primary. “expert” might be misleading for this one, maybe call it secondary use case.
which one would you like? can you provide a small code snippet to play with?