1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/packages/app-mobile/utils/testing/setupGlobalStore.ts

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;