Access an already created store?
See original GitHub issueThink I must be missing something here, so I apologise if that is the case, but I am trying to access to store after it is created. Mainly to allow me to add/modify (store.addModel) the model dynamically.
I was trying to simply use the easy-peasy context (easy-peasy/src/context) with useContext(), but that doesn’t seem to work…
import StoreContext from 'easy-peasy/src/context'
// in my component...
const store = useContext(StoreContext)
The store var is always undefined 😖
Any help would be appreciated, as it is late here and I’m tired, so am probably missing something obvious.
thx
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Create a database in Access
Open Access. If Access is already open, select File > New. · Select Blank database, or select a template. · Enter a name...
Read more >How to create store database on MS Access 2010 - YouTube
Subject: Information TechnologyCourse ID : 01219112Section : 450Student ID : 5610545722 [SKE11 KU]
Read more >How to access store in different component?
So I have a search bar where I store the queries with redux, which seems to work. I am now trying to access...
Read more >Accessing the Store | React Redux
Accessing the Store. React Redux provides APIs that allow your components to dispatch actions and subscribe to data updates from the store.
Read more >Access the Redux Store Outside a React Component
Here you are creating the store as you usually would, but then you are also exporting it. This will make it available to...
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

Released in v3.1.0
👍
In my app, I have a createStore.js file,. When I create the store, I set a module-level
storevar, and also export agetStore()method that returns the store var. I can access this helper from anywhere, including services that are outside of React context. Pseudo-code…I also export a createTestStore() that accepts an object with useful {optional} params like data, model and api to simplify testing. This also sets the
storevar so that all code usinggetStore()works inside tests.