vega-frontend-monorepo/libs/wallet/src/hooks.ts
Bartłomiej Głownia 8a829964be
Feature/38 data grid component (#77)
* Add ag-grid

* Add lazy loaded ag-grid component

* Add theme context, move VegaWallet to separate lib

* Fix trading app cypress configuration

* Lazy load ag-grid theme css files

* Encapsulate theme switch hook
2022-03-14 14:18:11 +01:00

11 lines
291 B
TypeScript

import { useContext } from 'react';
import { VegaWalletContext } from '.';
export function useVegaWallet() {
const context = useContext(VegaWalletContext);
if (context === undefined) {
throw new Error('useVegaWallet must be used within VegaWalletProvider');
}
return context;
}