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:
@@ -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)));
|
||||
}
|
||||
Reference in New Issue
Block a user