examples.waku.org/web-chat/src/WakuContext.ts

10 lines
299 B
TypeScript
Raw Normal View History

2022-06-17 10:48:15 +10:00
import { createContext, useContext } from "react";
import type { WakuLight } from "js-waku/lib/interfaces";
2022-06-17 10:48:15 +10:00
export type WakuContextType = {
waku?: WakuLight;
2022-06-17 10:48:15 +10:00
};
export const WakuContext = createContext<WakuContextType>({ waku: undefined });
export const useWaku = () => useContext(WakuContext);