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
+5 -5
View File
@@ -14,7 +14,7 @@ import { bnMax } from '@polkadot/util';
import { info } from '../accounts/info';
import { bestNumber } from '../chain/bestNumber';
import { DerivedBalances } from '../types';
import { drr, memo } from '../util';
import { drr } from '../util';
type ResultBalance = [Balance, Balance, BalanceLock[], Option<VestingSchedule>];
type Result = [AccountId, BlockNumber, ResultBalance, Index];
@@ -77,11 +77,11 @@ function queryBalances (api: ApiInterfaceRx, accountId: AccountId): Observable<R
* });
* ```
*/
export const all = memo((api: ApiInterfaceRx): (address: AccountIndex | AccountId | Address | string) => Observable<DerivedBalances> => {
export function all (api: ApiInterfaceRx): (address: AccountIndex | AccountId | Address | string) => Observable<DerivedBalances> {
const bestNumberCall = bestNumber(api);
const infoCall = info(api);
return memo((address: AccountIndex | AccountId | Address | string): Observable<DerivedBalances> => {
return (address: AccountIndex | AccountId | Address | string): Observable<DerivedBalances> => {
return infoCall(address).pipe(
switchMap(({ accountId }): Observable<Result> =>
(accountId
@@ -102,5 +102,5 @@ export const all = memo((api: ApiInterfaceRx): (address: AccountIndex | AccountI
map(calcBalances),
drr()
);
});
}, true);
};
}