Bump dev (w/ eslint 8) (#4070)

* Bump dev (w/ eslint 8)

* Additional linting

* Additional

* More lint fixes

* Last batch

* Additional

* Cleanups
This commit is contained in:
Jaco
2021-10-17 14:49:26 +03:00
committed by GitHub
parent 806fda67e9
commit 5eb3534d8e
46 changed files with 328 additions and 307 deletions
@@ -48,7 +48,7 @@ export function stakerExposures (instanceId: string, api: ApiInterfaceRx): (acco
export function stakerExposure (instanceId: string, api: ApiInterfaceRx): (accountId: Uint8Array | string, withActive?: boolean) => Observable<DeriveStakerExposure[]> {
return memo(instanceId, (accountId: Uint8Array | string, withActive = false): Observable<DeriveStakerExposure[]> =>
api.derive.staking.stakerExposures([accountId, withActive]).pipe(
api.derive.staking.stakerExposures([accountId], withActive).pipe(
map(([first]) => first)
)
);
+2 -2
View File
@@ -18,7 +18,7 @@ function wrapCache (keyStart: string, cache: DeriveCache): DeriveCache {
return {
del: (partial: string): void => cache.del(`${keyStart}${partial}`),
forEach: cache.forEach,
get: <T = any> (partial: string): T | undefined => {
get: <T> (partial: string): T | undefined => {
const key = `${keyStart}${partial}`;
const cached = cache.get<CacheValue<T>>(key);
@@ -40,7 +40,7 @@ function wrapCache (keyStart: string, cache: DeriveCache): DeriveCache {
function clearCache (cache: DeriveCache): void {
// clear all expired values
const now = Date.now();
const all: any[] = [];
const all: string[] = [];
cache.forEach((key: string, { x }: CacheValue<any>): void => {
((now - x) > CHACHE_EXPIRY) && all.push(key);
+1 -1
View File
@@ -21,5 +21,5 @@ export class ProposalFactory {
public proposalIndex = (index: number): ProposalIndex => {
return this.#registry.createType('ProposalIndex', index);
}
};
}