Skip to content

Commit af164a0

Browse files
authored
Merge pull request #25 from jk-gan/develop
Fix actionBlackList undefine error
2 parents 9f9cb91 + 1ed3437 commit af164a0

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
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-flipper",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Redux middleware for flipper",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/index.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@ type Configuration = {
66
actionsBlacklist: Array<string>;
77
};
88

9-
const defaultConfig: Configuration = { resolveCyclic: false, actionsBlacklist: [] };
9+
const defaultConfig: Configuration = {
10+
resolveCyclic: false,
11+
actionsBlacklist: [],
12+
};
1013

1114
let currentConnection: any = null;
1215
const error = {
1316
NO_STORE: 'NO_STORE',
1417
};
1518

16-
const createDebugger = ({ resolveCyclic, actionsBlacklist }: Configuration = defaultConfig) => (
17-
store: any,
18-
) => {
19+
const createDebugger = ({
20+
resolveCyclic,
21+
actionsBlacklist,
22+
}: Configuration = defaultConfig) => (store: any) => {
1923
if (currentConnection == null) {
2024
addPlugin({
2125
getId() {
@@ -44,7 +48,7 @@ const createDebugger = ({ resolveCyclic, actionsBlacklist }: Configuration = def
4448
},
4549
);
4650
},
47-
onDisconnect() { },
51+
onDisconnect() {},
4852
runInBackground() {
4953
return true;
5054
},
@@ -76,7 +80,7 @@ const createDebugger = ({ resolveCyclic, actionsBlacklist }: Configuration = def
7680
};
7781

7882
let blackListed = false;
79-
if (actionsBlacklist.length) {
83+
if (actionsBlacklist && actionsBlacklist.length) {
8084
for (const substr of actionsBlacklist) {
8185
if (action.type.includes(substr)) {
8286
blackListed = true;

0 commit comments

Comments
 (0)