hilkeheremans / redux-persist-seamless-immutable

Use seamless-immutable with redux-persist v5
MIT License
50 stars 11 forks source link

State.without is not a function. #11

Open el-lsan opened 5 years ago

el-lsan commented 5 years ago

Any idea what causing this:

image

Here's my codes:

import { createStore, applyMiddleware } from 'redux';
import { createLogger } from 'redux-logger';
import { persistReducer } from 'redux-persist';
import FilesystemStorage from 'redux-persist-filesystem-storage';
import { seamlessImmutableReconciler, seamlessImmutableTransformCreator } from 'redux-persist-seamless-immutable';
import reducers from '../reducers';

const transformerConfig = {
  whitelistPerReducer: {
    teams: ['logos'],
  },
  blacklistPerReducer: {
    competitions: ['items'],
  },
};

const persistConfig = {
  key: 'root',
  storage: FilesystemStorage,
  stateReconciler: seamlessImmutableReconciler,
  transforms: [seamlessImmutableTransformCreator(transformerConfig)],
};

const persistedReducer = persistReducer(persistConfig, reducers);

const isDebuggingInChrome = __DEV__ && !!window.navigator.userAgent;

const logger = createLogger({
  predicate: () => isDebuggingInChrome,
  collapsed: true,
  duration: true,
});
const createStoreWithMiddleware = applyMiddleware(logger)(createStore);

const store = createStoreWithMiddleware(persistedReducer);
if (isDebuggingInChrome) {
  window.store = store;
}

export default store;

However if I pass empty config object const transformerConfig = {}; everything works fine!

hilkeheremans commented 5 years ago

Hmmm. I realize this is a late response, but could you paste your reducer files as well?

hilkeheremans commented 5 years ago

Fixed in a fork: https://github.com/uxzc/redux-persist-seamless-immutable/commit/255a4993a0a508b9153b8046fba82f4b0ebee8d9

I'll pull this fix in in the next few days.

Technaur commented 4 years ago

Any update on this fix?