Skip to content

Commit

Permalink
Merge pull request #25 from jk-gan/develop
Browse files Browse the repository at this point in the history
Fix actionBlackList undefine error
  • Loading branch information
plwai authored Jul 17, 2020
2 parents 9f9cb91 + 1ed3437 commit af164a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-flipper",
"version": "1.3.0",
"version": "1.3.1",
"description": "Redux middleware for flipper",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
16 changes: 10 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ type Configuration = {
actionsBlacklist: Array<string>;
};

const defaultConfig: Configuration = { resolveCyclic: false, actionsBlacklist: [] };
const defaultConfig: Configuration = {
resolveCyclic: false,
actionsBlacklist: [],
};

let currentConnection: any = null;
const error = {
NO_STORE: 'NO_STORE',
};

const createDebugger = ({ resolveCyclic, actionsBlacklist }: Configuration = defaultConfig) => (
store: any,
) => {
const createDebugger = ({
resolveCyclic,
actionsBlacklist,
}: Configuration = defaultConfig) => (store: any) => {
if (currentConnection == null) {
addPlugin({
getId() {
Expand Down Expand Up @@ -44,7 +48,7 @@ const createDebugger = ({ resolveCyclic, actionsBlacklist }: Configuration = def
},
);
},
onDisconnect() { },
onDisconnect() {},
runInBackground() {
return true;
},
Expand Down Expand Up @@ -76,7 +80,7 @@ const createDebugger = ({ resolveCyclic, actionsBlacklist }: Configuration = def
};

let blackListed = false;
if (actionsBlacklist.length) {
if (actionsBlacklist && actionsBlacklist.length) {
for (const substr of actionsBlacklist) {
if (action.type.includes(substr)) {
blackListed = true;
Expand Down

0 comments on commit af164a0

Please sign in to comment.