mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -05:00
19 lines
494 B
TypeScript
19 lines
494 B
TypeScript
import React from 'react';
|
|
import { useInterpret } from '@xstate/react';
|
|
import { appMachine, logState } from '../machines/app';
|
|
|
|
import { GlobalContext } from '../shared/GlobalContext';
|
|
|
|
export const GlobalContextProvider: React.FC = (props) => {
|
|
const appService = useInterpret(appMachine);
|
|
|
|
// TODO: remove in production builds
|
|
appService.subscribe(logState);
|
|
|
|
return (
|
|
<GlobalContext.Provider value={{ appService }}>
|
|
{props.children}
|
|
</GlobalContext.Provider>
|
|
);
|
|
};
|