import { createContext } from "preact";
import { useContext } from "preact/compat";
import { Message } from "./FlashProvider";

export const FlashContext = createContext(null as (message: Message) => void);

export const useFlash = () => useContext(FlashContext);
