UNPKG

@sky-mavis/tanto-widget

Version:
7 lines 417 B
import {useContext}from'react';import {TantoWidgetError,TantoWidgetErrorCodes}from'../../utils/errors.mjs';import {TantoContext}from'./TantoContext.mjs';function useTanto() { const context = useContext(TantoContext); if (context === undefined) { throw new TantoWidgetError(TantoWidgetErrorCodes.CONTEXT_NOT_INITIALIZED, 'useTanto must be used within a TantoProvider'); } return context; }export{useTanto};