We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04fffae commit cdf0637Copy full SHA for cdf0637
libs/angular-three/src/lib/utils/instance.ts
@@ -16,10 +16,10 @@ export function invalidateInstance<TInstance extends object>(instance: TInstance
16
}
17
18
export function prepare<TInstance extends object = NgtAnyRecord>(
19
- object: TInstance,
+ object: TInstance | (() => TInstance),
20
localState?: Partial<NgtInstanceLocalState>
21
): NgtInstanceNode<TInstance> {
22
- const instance = object as unknown as NgtInstanceNode<TInstance>;
+ const instance = (typeof object === 'function' ? object() : object) as unknown as NgtInstanceNode<TInstance>;
23
24
if (localState?.primitive || !instance.__ngt__) {
25
const {
0 commit comments