UNPKG

@knine-sdk/react

Version:

React helpers for Knine Finance projects. Part of Knine JS SDK

12 lines (9 loc) 319 B
import { useContext } from 'react'; import invariant from 'tiny-invariant'; import { SDKContext } from '../context/SDK.js'; const useSDK = () => { const contextValue = useContext(SDKContext); invariant(contextValue, 'useSDK was used outside of SDKContext'); return contextValue; }; export { useSDK };