js-waku/examples/web-chat/src/WakuContext.ts
Franck Royer 065593b0cf
Revert naming to js-waku
To align with go-waku and nim-waku and keep bors working.
2021-05-13 20:27:38 +10:00

10 lines
269 B
TypeScript

import { createContext, useContext } from 'react';
import { Waku } from 'js-waku';
export type WakuContextType = {
waku?: Waku;
};
export const WakuContext = createContext<WakuContextType>({ waku: undefined });
export const useWaku = () => useContext(WakuContext);