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);