Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d200e3e commit 651cfe2Copy full SHA for 651cfe2
libs/core/src/lib/renderer/catalogue.ts
@@ -3,8 +3,18 @@ import type { NgtConstructorRepresentation } from '../types';
3
4
const catalogue: Record<string, NgtConstructorRepresentation> = {};
5
6
-export function extend(objects: object): void {
+export function extend(objects: object) {
7
+ const keys = Object.keys(objects);
8
Object.assign(catalogue, objects);
9
+ return () => {
10
+ remove(...keys);
11
+ };
12
+}
13
+
14
+export function remove(...keys: string[]) {
15
+ for (const key of keys) {
16
+ delete catalogue[key];
17
+ }
18
}
19
20
export const NGT_CATALOGUE = new InjectionToken<typeof catalogue>('NGT_CATALOGUE', { factory: () => catalogue });
0 commit comments