forked from profectus/Profectus
Fix a couple type issues
This commit is contained in:
parent
07fcccd0e4
commit
73d6fd7566
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ export function processComputable<T, S extends keyof ComputableKeysOf<T>>(
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj[key] = computed(computable.bind(obj));
|
obj[key] = computed(computable.bind(obj));
|
||||||
} else if (isFunction(computable)) {
|
} else if (isFunction(computable)) {
|
||||||
obj[key] = computable.bind(obj);
|
obj[key] = computable.bind(obj) as T[S];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
(obj[key] as any)[DoNotCache] = true;
|
(obj[key] as any)[DoNotCache] = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ export type ProxiedWithState<T> = NonNullable<T> extends Record<PropertyKey, any
|
||||||
|
|
||||||
// Takes a function that returns an object and pretends to be that object
|
// Takes a function that returns an object and pretends to be that object
|
||||||
// Note that the object is lazily calculated
|
// Note that the object is lazily calculated
|
||||||
export function createLazyProxy<T extends object, S>(
|
export function createLazyProxy<T extends object, S extends T>(
|
||||||
objectFunc: (baseObject: S) => T & S,
|
objectFunc: (baseObject: S) => T & S,
|
||||||
baseObject: S = {} as S
|
baseObject: S = {} as S
|
||||||
): T {
|
): T {
|
||||||
|
|
Loading…
Reference in a new issue