Remove derive memos (#1538)
* Remove derive memos * Remove outer memo * Over-eager replace
This commit is contained in:
@@ -11,15 +11,15 @@ import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { Bytes, Option, u32 } from '@polkadot/types';
|
||||
|
||||
import { overview as stakingOverview } from '../staking';
|
||||
import { drr, memo } from '../util';
|
||||
import { drr } from '../util';
|
||||
|
||||
/**
|
||||
* @description Return a boolean array indicating whether the passed accounts had received heartbeats in the current session
|
||||
*/
|
||||
export const receivedHeartbeats = memo((api: ApiInterfaceRx): () => Observable<DerivedHeartbeats> => {
|
||||
export function receivedHeartbeats (api: ApiInterfaceRx): () => Observable<DerivedHeartbeats> {
|
||||
const stakingOverviewvCall = stakingOverview(api);
|
||||
|
||||
return memo((): Observable<DerivedHeartbeats> => {
|
||||
return (): Observable<DerivedHeartbeats> => {
|
||||
return api.query.imOnline && api.query.imOnline.receivedHeartbeats && api.query.imOnline.authoredBlocks
|
||||
? stakingOverviewvCall().pipe(
|
||||
switchMap(({ currentIndex, validators }): Observable<[AccountId[], Option<Bytes>[], u32[]]> =>
|
||||
@@ -42,5 +42,5 @@ export const receivedHeartbeats = memo((api: ApiInterfaceRx): () => Observable<D
|
||||
drr()
|
||||
)
|
||||
: of({});
|
||||
});
|
||||
}, true);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user