Fix a couple type issues

This commit is contained in:
thepaperpilot 2022-10-14 07:44:12 -05:00
parent 1c1944a83d
commit a356c3f676
2 changed files with 2 additions and 2 deletions

View file

@ -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;
} }

View file

@ -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 {