Closed zeratax closed 4 years ago
I wanted to use the starter kit with persistent localstorage as seen here: https://github.com/notwaldorf/flash-cards/blob/master/src/localStorage.js
Which works great as long as I have the redux devTools installed, but without whenever I lazy load a reducer, like e.g. here: https://github.com/Polymer/pwa-starter-kit/blob/master/src/components/my-view2.js#L21 https://github.com/Polymer/pwa-helpers/blob/master/src/lazy-reducer-enhancer.ts#L39
That part of the state gets reset to the initial state configuration. This seems to happen after the @@redux/REPLACE action is fired.
Adding these reducers to store.js fixes this, but obviously renders the lazy loading useless
store.js
How would I go about having lazy loaded reducers check if state is already there?
This project is no longer under development and will be transitioning to a read-only repo. Thank you for your contributions.
I wanted to use the starter kit with persistent localstorage as seen here: https://github.com/notwaldorf/flash-cards/blob/master/src/localStorage.js
Which works great as long as I have the redux devTools installed, but without whenever I lazy load a reducer, like e.g. here: https://github.com/Polymer/pwa-starter-kit/blob/master/src/components/my-view2.js#L21 https://github.com/Polymer/pwa-helpers/blob/master/src/lazy-reducer-enhancer.ts#L39
That part of the state gets reset to the initial state configuration. This seems to happen after the @@redux/REPLACE action is fired.
Adding these reducers to
store.js
fixes this, but obviously renders the lazy loading uselessHow would I go about having lazy loaded reducers check if state is already there?