hilkeheremans / redux-persist-seamless-immutable

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

Update transformer.js to make sure the state is valid #16

Closed tamdao closed 3 years ago

tamdao commented 3 years ago

The redux lib allow to set initial state is null. But with your logic, don't check the state is null or not. So if the state is null, the Object.keys will throw exception. You can check the message of redux here: https://github.com/reduxjs/redux/blob/master/src/combineReducers.ts#L70

My PR to fix this issue. This issue happens on production of our app. Could you please help me review and make a new build for your lib.

Thanks so much

tamdao commented 3 years ago

@hilkeheremans please help me review it