Git Product home page Git Product logo

redux-persist-seamless-immutable's Issues

Fails to compile

Hi, thanks for you efforts!
However, I'm having problems compiling this.

./node_modules/redux-persist-seamless-immutable/src/reconciler.js
Module parse failed: Unexpected token (9:19)
You may need an appropriate loader to handle this file type.

|   { debug, mergeDeep = false }
| ) => {
|   let newState = { ...reducedState };
|   // only rehydrate if inboundState exists and is an object
|   if (inboundState && typeof inboundState === 'object') {

My project uses create-react-app.
Node: v8.8.0

seamlessImmutableReconciler

I'm looking into using this library since I'm currently using seamless-immutable lib and an old version of redux persist.

I was wondering if this Reconciler matches autoMergeLevel2?

Thank you for your work on this lib 🥇

State.without is not a function.

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!

transformer.js:32 Uncaught TypeError: Cannot convert undefined or null to object

Hello, I'm getting following error. how can i fix it? Thanks!
Config:
const transformerConfig = {
whitelistPerReducer: {

},
blacklistPerReducer: {

}
}

Error:
transformer.js:32 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys ()
at transformer.js:32:1
at Object._in [as in] (createTransform.js:16:1)
at createPersistoid.js:66:1
at Array.reduce ()
at processNextKey (createPersistoid.js:65:1)

TypeError: Cannot read property ‘merge’ of undefined

At times the reconciler fails to merge and throws this error.
I was unable to pin point when exactly this happens or why.
Presumably after larger state structure change.

Uncaught (in promise) TypeError: Cannot read property ‘merge’ of undefined
   at reconciler.js:34
   at Array.forEach (<anonymous>)
   at s (reconciler.js:16)
   at persistReducer.js:91
   at n (reduxsauce.js:229)
   at l (createStore.js:165)
   at middleware.js:71
   at index.js:48
   at Object.dispatch (middleware.js:66)
   at Object.l [as rehydrate] (persistStore.js:87)
   at persistReducer.js:57
(anonymous) @ reconciler.js:34
s @ reconciler.js:16
(anonymous) @ persistReducer.js:91
n @ reduxsauce.js:229
l @ createStore.js:165
(anonymous) @ middleware.js:71
(anonymous) @ index.js:48
(anonymous) @ middleware.js:66
l @ persistStore.js:87
(anonymous) @ persistReducer.js:57
Promise.then (async)
(anonymous) @ persistReducer.js:56
Promise.then (async)
(anonymous) @ persistReducer.js:52
n @ reduxsauce.js:229
l @ createStore.js:165
(anonymous) @ middleware.js:71
(anonymous) @ index.js:48
(anonymous) @ middleware.js:66
s.persist @ persistStore.js:96
o @ persistStore.js:99
t.a @ CreateStore.js:37
t.a @ index.js:47
(anonymous) @ App.js:14
t @ bootstrap abaa5d98ccee410482ed:19
(anonymous) @ main.b4c585ff.js:71680
t @ bootstrap abaa5d98ccee410482ed:19
(anonymous) @ main.b4c585ff.js:65389
t @ bootstrap abaa5d98ccee410482ed:19
(anonymous) @ bootstrap abaa5d98ccee410482ed:62
(anonymous) @ bootstrap abaa5d98ccee410482ed:62

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.