1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-mobile/utils/testing/setupGlobalStore.ts

17 lines
583 B
TypeScript
Raw Normal View History

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;