Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const configureStore = () => {
// redux-persist config
const persistConfig = {
version: 1,
key: 'root',
migrate: createMigrate(migrations as any, { debug: electronIsDev }),
storage,
transforms: [functionTransform, outputTransformers, passwordTransform],
blacklist: ['notifications']
};
const persistedReducer = persistReducer(persistConfig, rootReducer);
const composeEnhancers =
(window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const middlewares = [thunk as ThunkMiddleware];
if (electronIsDev) {
middlewares.push(
createLogger({
predicate: (_, action) => !/^@@/.test(action.type),
collapsed: true
const migrations = {
0: (state: AppState) => {
// migration clear out device state
return initialStateApp;
}
};
const persistConfig = {
key: "root",
version: 0,
storage,
whitelist: ["auth"],
transforms: [transform],
// @ts-ignore
migrate: createMigrate(migrations, { debug: false })
};
const compose = composeWithDevTools({});
const logger = createLogger({});
const persistedReducer = persistReducer(persistConfig, reducer);
let middlewares;
if (process.env.NODE_ENV === "development") {
middlewares = compose(applyMiddleware(thunk, logger));
} else {
middlewares = applyMiddleware(thunk);
}
const store = createStore(
import { createMigrate, persistStore, persistReducer } from 'redux-persist';
import { createEpicMiddleware, combineEpics } from 'redux-observable';
import storage from 'redux-persist/lib/storage'; // default: localStorage if web
import thunk from 'redux-thunk';
import migrations from './migrations';
import reducers from '../reducers';
import { epics } from '../epics';
import Backend from '../components/projecteditor/control/backend';
// Redux Persist config
const config = {
key: 'root',
storage,
version: 5,
whitelist: ['projects', 'settings'],
migrate: createMigrate(migrations, { debug: true })
};
const combineReducers = reducers => {
return (state = {}, action) => {
// Reduce all the keys for reducers from `todos` and `visibilityFilter`
return Object.keys(reducers).reduce(
(nextState, key) => {
// Call the corresponding reducer function for a given key
nextState[key] = reducers[key] (
state[key],
action,
// Let's make the entire state available to all reducers
state
);
return nextState;
import { createMigrate, persistStore, persistReducer } from 'redux-persist';
import { createEpicMiddleware, combineEpics } from 'redux-observable';
import { loadingBarMiddleware } from 'react-redux-loading-bar'
import storage from 'redux-persist/lib/storage'; // default: localStorage if web
import thunk from 'redux-thunk';
import migrations from './migrations';
import reducers from '../reducers';
import { epics } from '../epics';
// Redux Persist config
const config = {
key: 'root',
storage,
version: 5,
whitelist: ['settings'],
migrate: createMigrate(migrations, { debug: true })
};
const combineReducers = reducers => {
return (state = {}, action) => {
// Reduce all the keys for reducers from `todos` and `visibilityFilter`
return Object.keys(reducers).reduce(
(nextState, key) => {
// Call the corresponding reducer function for a given key
nextState[key] = reducers[key] (
state[key],
action,
// Let's make the entire state available to all reducers
state
);
return nextState;
import { createMigrate, persistStore, persistReducer } from 'redux-persist';
import { createEpicMiddleware, combineEpics } from 'redux-observable';
import { loadingBarMiddleware } from 'react-redux-loading-bar'
import storage from 'redux-persist/lib/storage'; // default: localStorage if web
import thunk from 'redux-thunk';
import migrations from './migrations';
import reducers from '../reducers';
import { epics } from '../epics';
// Redux Persist config
const config = {
key: 'root',
storage,
version: 1,
whitelist: [''],
migrate: createMigrate(migrations, { debug: true })
};
const combineReducers = reducerList => {
return (state = {}, action) => {
// Reduce all the keys for reducers from `todos` and `visibilityFilter`
return Object.keys(reducerList).reduce(
(nextState, key) => {
// Call the corresponding reducer function for a given key
nextState[key] = reducerList[key] (
state[key],
action,
// Let's make the entire state available to all reducers
state
);
return nextState;
import { AsyncStorage } from 'react-native'
import { createMigrate, PersistConfig, MigrationManifest } from 'redux-persist'
const migrations: MigrationManifest = {
0: (persistedState) => {
const state = persistedState as any
return state
}
}
const persistConfig: PersistConfig = {
key: 'primary',
storage: AsyncStorage,
version: 0,
// whitelist: ['main'],
migrate: createMigrate(migrations, { debug: true })
}
export default persistConfig
settings: newSettings
});
},
3: state => {
const { settings } = state;
const newSettings = Object.assign({}, settings);
newSettings.exchangeCurrency = 'usd';
}
};
// configure persistor
const persistConfig = {
version: 3,
key: 'root',
storage,
migrate: createMigrate(migrations, { debug: true }),
whitelist: ['settings', 'contacts'],
debug: true
};
export default persistConfig;
*/
15: (state) => Object.assign({}, state, {
blockchains: update014(state.blockchains),
}),
/*
16 - Update default insights node
*/
16: (state) => Object.assign({}, state, {
blockchains: update016(state.blockchains),
}),
};
const persistConfig = {
key: 'eos-voter-config',
version: 16,
migrate: createMigrate(migrations, { debug: true }),
storage: createElectronStorage(),
timeout: 0, // The code base checks for falsy, so 0 disables
whitelist: [
'blockchains',
'settings',
'wallet',
'wallets'
]
};
export default persistConfig;
}
}
}
const persistConfig: PersistConfig = {
key: 'primary',
storage: AsyncStorage,
version: 24,
whitelist: [
'account',
'preferences',
'deviceLogs',
'initialization',
'groups'
],
migrate: createMigrate(migrations, { debug: false }),
debug: false
}
const rootReducer = combineReducers({
auth: authReducer,
contacts: contactsReducer,
updates: updatesReducer,
groups: groupsReducer,
preferences: preferencesReducer,
photoViewing: photoViewingReducer,
threads: threadsReducer,
ui: uiReducer,
startup: startupReducer,
deviceLogs: deviceLogsReducer,
account: accountReducer,
textile: textileEventsReducer,
...state,
cameraRoll: {
...state.cameraRoll,
pendingImageShares: [],
pendingThreadShares: {}
}
}
}
}
const persistConfig: PersistConfig = {
key: 'primary',
storage: AsyncStorage,
version: 5,
whitelist: ['preferences', 'uploadingImages', 'cameraRoll', 'contacts'],
migrate: createMigrate(migrations, { debug: false })
}
export default persistConfig