mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 05:27:57 -05:00
* feat(inji-344): add flipper config for mmkv and xstate * feat(inji-409): Add flipper config file and enable devtools for all machines * feat(inji-409): Add react-navigation to flipper config
20 lines
489 B
TypeScript
20 lines
489 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, {devTools: __DEV__});
|
|
|
|
if (__DEV__) {
|
|
appService.subscribe(logState);
|
|
}
|
|
|
|
return (
|
|
<GlobalContext.Provider value={{appService}}>
|
|
{props.children}
|
|
</GlobalContext.Provider>
|
|
);
|
|
};
|