Use any
keys, fixes most errors!
This commit is contained in:
parent
a54b6ee8a3
commit
0cebcc05a5
1 changed files with 4 additions and 4 deletions
|
@ -74,8 +74,8 @@ import type { EntityStore } from 'soapbox/entity-store/types';
|
||||||
import type { Account } from 'soapbox/schemas';
|
import type { Account } from 'soapbox/schemas';
|
||||||
|
|
||||||
interface LegacyImmutable<T> {
|
interface LegacyImmutable<T> {
|
||||||
get(key: string): (T & LegacyImmutable<T>) | undefined
|
get(key: any): (T & LegacyImmutable<T>) | undefined
|
||||||
getIn(keyPath: string[]): unknown
|
getIn(keyPath: any[]): unknown
|
||||||
find(predicate: (value: T & LegacyImmutable<T>, key: string) => boolean): T & LegacyImmutable<T> | undefined
|
find(predicate: (value: T & LegacyImmutable<T>, key: string) => boolean): T & LegacyImmutable<T> | undefined
|
||||||
toJS(): any
|
toJS(): any
|
||||||
}
|
}
|
||||||
|
@ -84,12 +84,12 @@ function immutableize<T, S extends Record<string, T | undefined>>(state: S): S &
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
|
||||||
get(id: string): T & LegacyImmutable<T> | undefined {
|
get(id: any): T & LegacyImmutable<T> | undefined {
|
||||||
const entity = state[id];
|
const entity = state[id];
|
||||||
return entity ? immutableize(entity) : undefined;
|
return entity ? immutableize(entity) : undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
getIn(keyPath: string[]): unknown {
|
getIn(keyPath: any[]): unknown {
|
||||||
return lodashGet(state, keyPath);
|
return lodashGet(state, keyPath);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue