From af37e28143e3f0bc3b1f5d1841ceb221ffb89fa5 Mon Sep 17 00:00:00 2001 From: AOHUA MU Date: Sun, 13 Jan 2019 10:59:31 +0800 Subject: [PATCH] fix lint --- types/redux-state-sync/index.d.ts | 1 + types/redux-state-sync/package.json | 7 +++++++ types/redux-state-sync/redux-state-sync-tests.ts | 8 +++----- 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 types/redux-state-sync/package.json diff --git a/types/redux-state-sync/index.d.ts b/types/redux-state-sync/index.d.ts index 329f56908b..755d354707 100644 --- a/types/redux-state-sync/index.d.ts +++ b/types/redux-state-sync/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: MU AOHUA // AntonioMendez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 import { Store, Reducer, Middleware, AnyAction } from "redux"; import BroadcastChannel from "broadcast-channel"; diff --git a/types/redux-state-sync/package.json b/types/redux-state-sync/package.json new file mode 100644 index 0000000000..d39f9e8fc6 --- /dev/null +++ b/types/redux-state-sync/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "broadcast-channel": "^2.1.8", + "redux": "^4.0.1" + } +} diff --git a/types/redux-state-sync/redux-state-sync-tests.ts b/types/redux-state-sync/redux-state-sync-tests.ts index 17e73dd591..3f5e689675 100644 --- a/types/redux-state-sync/redux-state-sync-tests.ts +++ b/types/redux-state-sync/redux-state-sync-tests.ts @@ -6,19 +6,17 @@ interface TestState { b: string; c: string; } -const middlewares = [ - createStateSyncMiddleware({ +const middleware = createStateSyncMiddleware({ channel: 'test', predicate: (type) => true, blacklist: [], whitelist: [], broadcastChannelOption: {} - }), -]; + }); function rootReducer(state: TestState, action: Action): TestState { return state; } -const store = createStore(withReduxStateSync(rootReducer), ['test'], ...applyMiddleware(middlewares)); +const store = createStore(withReduxStateSync(rootReducer), ['test'], applyMiddleware(middleware)); initStateWithPrevTab(store);