Skip to content

Commit

Permalink
Don't assign getAllKeys to storage for localForage (#175)
Browse files Browse the repository at this point in the history
Assigning the additional key kills the some of the localForage
functionality because the prototype methods are not carried over.
  • Loading branch information
willmcclellan authored and rt2zz committed Sep 23, 2016
1 parent 6875fc8 commit 3e1b0d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/createPersistor.js
Expand Up @@ -22,7 +22,9 @@ export default function createPersistor (store, config) {

// storage with keys -> getAllKeys for localForage support
let storage = config.storage || createAsyncLocalStorage('local')
if (storage.keys && !storage.getAllKeys) storage = {...storage, getAllKeys: storage.keys}
if (storage.keys && !storage.getAllKeys) {
storage.getAllKeys = storage.keys
}

// initialize stateful values
let lastState = stateInit
Expand Down

0 comments on commit 3e1b0d4

Please sign in to comment.