Remove double-up-drr (memo vs rpc) (#1541)

* Remove inner memo (no double-up on stringify)

* Validators-specific query
This commit is contained in:
Jaco Greeff
2019-11-03 23:47:55 +01:00
committed by GitHub
parent d39878c875
commit 2371d6a29c
38 changed files with 100 additions and 93 deletions
@@ -16,7 +16,7 @@ import { drr, memo } 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>[]]> =>
return (): Observable<[AccountId[], Option<AccountId>[]]> =>
api.query.staking.validators<[AccountId[]] & Codec>().pipe(
switchMap(([stashIds]): Observable<[AccountId[], Option<AccountId>[]]> =>
combineLatest([
@@ -28,5 +28,5 @@ export const controllers = memo((api: ApiInterfaceRx): () => Observable<[Account
])
),
drr()
));
);
}, true);