elgerlambert/redux-localstorage

default to window.localStorage instead of localStorage?

Los83 opened this issue · 0 comments

Los83 commented

When testing with mocha in circle ci leaving the defaults generates the following error
ReferenceError: localStorage is not defined
at Object. (node_modules/redux-localstorage/lib/persistState.js:29:61)
which stubbing localStorage in mocha does not fix. Changing the localStorage line 29 to window.localStorage fixed the problem for me, but I had to do it in a fork. If there is any way you could use window.localStorage instead of the global localStorage or have localStorage default to window.localStorage or instruct me on a workaround, I would appreciate it. Thank you for the module