Skip to content

Commit 0bdd9a7

Browse files
committed
feat(core): remove unused code, expose resolveInstanceKey in applyProps
1 parent baa9cd0 commit 0bdd9a7

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

libs/core/src/lib/utils/apply-props.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,7 @@ const colorMaps = ['map', 'emissiveMap', 'sheenColorMap', 'specularColorMap', 'e
3535

3636
type ClassConstructor = { new (): void };
3737

38-
const MEMOIZED_PROTOTYPES = new Map();
39-
40-
function getMemoizedPrototype(root: any) {
41-
let ctor = MEMOIZED_PROTOTYPES.get(root.constructor);
42-
try {
43-
if (!ctor) {
44-
ctor = new root.constructor();
45-
MEMOIZED_PROTOTYPES.set(root.constructor, ctor);
46-
}
47-
} catch (e) {
48-
// ...
49-
}
50-
return ctor;
51-
}
52-
53-
function resolve(instance: any, key: string): { root: any; targetKey: string; targetProp: any } {
38+
export function resolveInstanceKey(instance: any, key: string): { root: any; targetKey: string; targetProp: any } {
5439
let targetProp = instance[key];
5540
if (!key.includes('.')) return { root: instance, targetKey: key, targetProp };
5641

@@ -98,7 +83,7 @@ export function applyProps<T extends NgtAnyRecord>(instance: NgtInstanceState<T>
9883
// }
9984
// }
10085

101-
const { root, targetKey, targetProp } = resolve(instance, key);
86+
const { root, targetKey, targetProp } = resolveInstanceKey(instance, key);
10287

10388
// we have switched due to pierced props
10489
if (root !== instance) {

0 commit comments

Comments
 (0)