UNPKG

@baqhub/sdk-react

Version:

The official React SDK for the BAQ federated app platform.

16 lines (15 loc) 431 B
import { createContext, useContext } from "react"; export function buildStoreContext() { const StoreContext = createContext(undefined); function useStoreContext() { const storeContext = useContext(StoreContext); if (!storeContext) { throw new Error("Store provider is required."); } return storeContext; } return { StoreContext, useStoreContext, }; }