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
@@ -10,13 +10,13 @@ import { Observable, combineLatest, of } from 'rxjs';
import { switchMap } from 'rxjs/operators';
import { Option } from '@polkadot/types';
import { drr, memo } from '../util';
import { drr } from '../util';
/**
* @description From the list of stash accounts, retrieve the list of controllers
*/
export const controllers = memo((api: ApiInterfaceRx): () => Observable<[AccountId[], Option<AccountId>[]]> => {
return memo((): Observable<[AccountId[], Option<AccountId>[]]> =>
export function controllers (api: ApiInterfaceRx): () => Observable<[AccountId[], Option<AccountId>[]]> {
return (): Observable<[AccountId[], Option<AccountId>[]]> =>
api.query.staking.validators<[AccountId[]] & Codec>().pipe(
switchMap(([stashIds]): Observable<[AccountId[], Option<AccountId>[]]> =>
combineLatest([
@@ -28,6 +28,5 @@ export const controllers = memo((api: ApiInterfaceRx): () => Observable<[Account
])
),
drr()
)
);
}, true);
);
}