diff --git a/src/EventBus.ts b/src/EventBus.ts new file mode 100644 index 0000000..9388418 --- /dev/null +++ b/src/EventBus.ts @@ -0,0 +1,5 @@ +import { EventEmitter } from 'events'; +import { createContext } from 'react'; + +export const eventBus = new EventEmitter(); +export const EventBusContext = createContext(eventBus); diff --git a/src/main.tsx b/src/main.tsx index 7ce7f9e..4bc7e97 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -3,6 +3,7 @@ import { useColorScheme } from '@mantine/hooks'; import { Notifications } from '@mantine/notifications'; import React, { FC, useState } from 'react'; import ReactDOM from 'react-dom/client'; +import { eventBus, EventBusContext } from './EventBus'; import { MainLayout } from './MainLayout'; import { useAppTheme } from './theme'; @@ -13,12 +14,14 @@ const AppMain: FC = () => { return ( - - - - - - + + + + + + + + ); };