diff options
Diffstat (limited to 'packages/website/ts/redux/store.ts')
-rw-r--r-- | packages/website/ts/redux/store.ts | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/packages/website/ts/redux/store.ts b/packages/website/ts/redux/store.ts deleted file mode 100644 index 006241371..000000000 --- a/packages/website/ts/redux/store.ts +++ /dev/null @@ -1,24 +0,0 @@ -import * as _ from 'lodash'; -import { applyMiddleware, createStore, Store as ReduxStore } from 'redux'; -import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; -import { stateStorage } from 'ts/local_storage/state_storage'; -import { analyticsMiddleware } from 'ts/redux/analyticsMiddleware'; -import { reducer, State } from 'ts/redux/reducer'; - -const ONE_SECOND = 1000; - -export const store: ReduxStore<State> = createStore( - reducer, - stateStorage.getPersistedDefaultState(), - composeWithDevTools(applyMiddleware(analyticsMiddleware)), -); -store.subscribe( - _.throttle(() => { - const state = store.getState(); - // Persisted state - stateStorage.saveState({ - hasPortalOnboardingBeenClosed: state.hasPortalOnboardingBeenClosed, - isPortalOnboardingShowing: state.isPortalOnboardingShowing, - }); - }, ONE_SECOND), -); |