Skip to content
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

How to stop/disable/pause syncing? #156

Closed
EvgenyOrekhov opened this issue Sep 26, 2022 · 1 comment
Closed

How to stop/disable/pause syncing? #156

EvgenyOrekhov opened this issue Sep 26, 2022 · 1 comment

Comments

@EvgenyOrekhov
Copy link

I need the ability to disable/enable syncing depending on a prop in Redux state. Is it possible?

@EvgenyOrekhov
Copy link
Author

I ended up creating a middleware wrapper for that:

const conditionalStateSyncMiddleware: Middleware<unknown, RootState> =
  store => next => action =>
    store.getState().isStateSyncEnabled
      ? stateSyncMiddleware(store)(next)(action)
      : next(action);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant