Skip to content

Commit 1bb0188

Browse files
author
Zack Story
committed
allow empty keyPrefix
1 parent 267430b commit 1bb0188

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-persist",
3-
"version": "4.0.0-alpha3",
3+
"version": "4.0.0-alpha4",
44
"description": "persist and rehydrate redux stores",
55
"main": "lib/index.js",
66
"scripts": {

src/createPersistor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function createPersistor (store, config) {
1212
const whitelist = config.whitelist || false
1313
const transforms = config.transforms || []
1414
const debounce = config.debounce || false
15-
const keyPrefix = config.keyPrefix || KEY_PREFIX
15+
const keyPrefix = config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX
1616

1717
// pluggable state shape (e.g. immutablejs)
1818
const stateInit = config._stateInit || {}

src/getStoredState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function getStoredState (config, onComplete) {
88
const blacklist = config.blacklist || []
99
const whitelist = config.whitelist || false
1010
const transforms = config.transforms || []
11-
const keyPrefix = config.keyPrefix || KEY_PREFIX
11+
const keyPrefix = config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX
1212

1313
// fallback getAllKeys to `keys` if present (LocalForage compatability)
1414
if (storage.keys && !storage.getAllKeys) storage = {...storage, getAllKeys: storage.keys}

src/purgeStoredState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { KEY_PREFIX } from './constants'
22

33
export default function purgeStoredState (config, keys) {
44
const storage = config.storage
5-
const keyPrefix = config.keyPrefix || KEY_PREFIX
5+
const keyPrefix = config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX
66

77
// basic validation
88
if (Array.isArray(config)) throw new Error('redux-persist: purgeStoredState requires config as a first argument (found array). An array of keys is the optional second argument.')

0 commit comments

Comments
 (0)