mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
17 lines
583 B
TypeScript
17 lines
583 B
TypeScript
|
import { Store } from 'redux';
|
||
|
import { AppState } from '../types';
|
||
|
import initializeCommandService from '../initializeCommandService';
|
||
|
import BaseSyncTarget from '@joplin/lib/BaseSyncTarget';
|
||
|
import NavService from '@joplin/lib/services/NavService';
|
||
|
import BaseModel from '@joplin/lib/BaseModel';
|
||
|
|
||
|
// Sets a given Redux store as global
|
||
|
const setupGlobalStore = (store: Store<AppState>) => {
|
||
|
BaseModel.dispatch = store.dispatch;
|
||
|
BaseSyncTarget.dispatch = store.dispatch;
|
||
|
NavService.dispatch = store.dispatch;
|
||
|
initializeCommandService(store);
|
||
|
};
|
||
|
|
||
|
export default setupGlobalStore;
|