useApi.ts 421 B

123456789101112
  1. // Copyright 2017-2020 @polkadot/react-hooks authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import { ApiProps } from '@polkadot/react-api/types';
  5. import { useContext } from 'react';
  6. import { ApiContext } from '@polkadot/react-api';
  7. export default function useApi (): ApiProps {
  8. return useContext(ApiContext);
  9. }