* Move api-derive to correct location * Adjust (linting ok) * No composite * ApiDerive split * Adjust * Still WIP, getting closer * It lints * derive build issues sorted * It builds :) * Add system_health to mock * api-augment usage * Cleanups * Adjust paths * linting * Some <'s * Revert <>'s * linting * ordering * Augmentation tweaks * yarn.lock * export
22 lines
695 B
TypeScript
22 lines
695 B
TypeScript
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { Observable } from 'rxjs';
|
|
import type { AccountId } from '@polkadot/types/interfaces';
|
|
import type { DeriveApi, DeriveSocietyMember } from '../types';
|
|
|
|
import { map } from 'rxjs';
|
|
|
|
import { memo } from '../util';
|
|
|
|
/**
|
|
* @description Get the member info for a society
|
|
*/
|
|
export function member (instanceId: string, api: DeriveApi): (accountId: AccountId) => Observable<DeriveSocietyMember> {
|
|
return memo(instanceId, (accountId: AccountId): Observable<DeriveSocietyMember> =>
|
|
api.derive.society._members([accountId]).pipe(
|
|
map(([result]) => result)
|
|
)
|
|
);
|
|
}
|