10 lines
269 B
TypeScript
Raw Normal View History

2021-04-19 11:34:13 +10:00
import { createContext, useContext } from 'react';
2021-05-13 10:36:28 +10:00
import { Waku } from 'waku-js';
2021-04-19 11:34:13 +10:00
export type WakuContextType = {
2021-04-21 15:51:52 +10:00
waku?: Waku;
2021-04-19 12:55:33 +10:00
};
2021-04-19 11:34:13 +10:00
export const WakuContext = createContext<WakuContextType>({ waku: undefined });
export const useWaku = () => useContext(WakuContext);