Remove derive memos (#1538)

* Remove derive memos

* Remove outer memo

* Over-eager replace
This commit is contained in:
Jaco Greeff
2019-11-03 11:38:36 +01:00
committed by GitHub
parent 0e037de1b1
commit 506b042f8c
44 changed files with 273 additions and 305 deletions
@@ -8,19 +8,18 @@ import { ApiInterfaceRx } from '@polkadot/api/types';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { drr, memo } from '../util';
import { drr } from '../util';
import { overview } from './overview';
/**
* @description Retrieve latest list of validators
*/
export const validators = memo((api: ApiInterfaceRx): () => Observable<AccountId[]> => {
export function validators (api: ApiInterfaceRx): () => Observable<AccountId[]> {
const overviewCall = overview(api);
return memo((): Observable<AccountId[]> =>
return (): Observable<AccountId[]> =>
overviewCall().pipe(
map(({ validators }): AccountId[] => validators),
drr()
)
);
}, true);
);
}