examples.waku.org/web-chat/src/WakuContext.ts
2022-09-14 22:49:32 +10:00

10 lines
299 B
TypeScript

import { createContext, useContext } from "react";
import type { WakuLight } from "js-waku/lib/interfaces";
export type WakuContextType = {
waku?: WakuLight;
};
export const WakuContext = createContext<WakuContextType>({ waku: undefined });
export const useWaku = () => useContext(WakuContext);