-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathcontext.ts
More file actions
29 lines (25 loc) · 1.04 KB
/
context.ts
File metadata and controls
29 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { setContextEventEmitter, getContextEventEmitter } from 'utils-event-emitter';
import { setContextXstate, getContextXstate } from 'utils-xstate';
import { setContextLayout, getContextLayout } from 'utils-layout';
import { setContextApp, getContextApp } from 'pixi-svelte';
import { eventEmitter, type EmitterEvent } from './eventEmitter';
import { stateXstate, stateXstateDerived } from './stateXstate';
import { stateLayout, stateLayoutDerived } from './stateLayout';
import { stateApp } from './stateApp';
import { stateGame, stateGameDerived } from './stateGame.svelte';
import { i18nDerived } from '../i18n/i18nDerived';
export const setContext = () => {
setContextEventEmitter<EmitterEvent>({ eventEmitter });
setContextXstate({ stateXstate, stateXstateDerived });
setContextLayout({ stateLayout, stateLayoutDerived });
setContextApp({ stateApp });
};
export const getContext = () => ({
...getContextEventEmitter<EmitterEvent>(),
...getContextLayout(),
...getContextXstate(),
...getContextApp(),
stateGame,
stateGameDerived,
i18nDerived,
});