mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
23 lines
650 B
TypeScript
23 lines
650 B
TypeScript
import { createStore, applyMiddleware, Action } from "redux";
|
|
import { createStateSyncMiddleware, initStateWithPrevTab, withReduxStateSync } from "redux-state-sync";
|
|
|
|
interface TestState {
|
|
a: number;
|
|
b: string;
|
|
c: string;
|
|
}
|
|
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(middleware));
|
|
initStateWithPrevTab(store);
|