Skip to content

Resetting Zustand stores #2829

Answered by dbritto-dev
biggyspender asked this question in Q&A
Discussion options

You must be logged in to vote

so something like this:

store = createStore(() => {
  // don't add side effect to your store here
  return { ... }
})

should be like this

store = createStore(() => {
  return { ... }
})

// add side effects to your store here

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@biggyspender
Comment options

@dbritto-dev
Comment options

@dbritto-dev
Comment options

Answer selected by biggyspender
@dbritto-dev
Comment options

@biggyspender
Comment options

@dbritto-dev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants