ghost-portal/packages/page-society/src/useCounter.ts
Jaco Greeff 268d4dd557
Show society skeptics & voters (#4879)
* Show society skeptics & voters

* useCounter for candidates

* Sort founder to bottom

* payouts due

* sizing

* remove header
2021-03-20 17:01:48 +01:00

14 lines
391 B
TypeScript

// Copyright 2017-2021 @polkadot/app-society authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bid } from '@polkadot/types/interfaces';
import { useApi, useCall } from '@polkadot/react-hooks';
export default function useCounter (): number {
const { api } = useApi();
const bids = useCall<Bid[]>(api.query.society?.candidates);
return bids?.length || 0;
}