Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • You may be able to create a store object first, then create a function that returns it instead of creating a store. Can you edit to include an example minimal reproducible example where you are wanting/trying to access the store outside the expected areas? Commented Jan 10, 2024 at 17:21
  • Hi @DrewReese, I have edited the code snipped including a place where I need to access the store. Commented Jan 11, 2024 at 7:43
  • From the above snippet, I am able to dispatch signoutUser function but, its just for the name sake, Its not doing any activities at all, not updating data to local storage or doing anything at all. Whereas if I call the same from a react component, It is updating the persist store data Commented Jan 11, 2024 at 9:55