Cleanups for maintainability (#2809)

* Cleanups for maintainability

* Split referendumsInfo

* Extract didUpdate -> bool

* Era filtering

* Default to council

* Points cache

* Remove cache

* Move map arg
This commit is contained in:
Jaco Greeff
2020-10-30 14:28:38 +01:00
committed by GitHub
parent de38735498
commit 161c121cb2
18 changed files with 161 additions and 122 deletions
+8
View File
@@ -0,0 +1,8 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { EraIndex } from '@polkadot/types/interfaces';
export function filterEras <T extends { era: EraIndex }> (eras: EraIndex[], list: T[]): EraIndex[] {
return eras.filter((era) => !list.some((entry) => era.eq(entry.era)));
}