feat: update some shit
This commit is contained in:
11
components/helpers/withSubComponents.ts
Normal file
11
components/helpers/withSubComponents.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export function withSubComponents<A, B extends Record<string, any>>(
|
||||
component: A,
|
||||
subcomponents: B,
|
||||
): A & B {
|
||||
Object.keys(subcomponents).forEach((key) => {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
(component as any)[key] = (subcomponents as any)[key];
|
||||
});
|
||||
return component as A & B;
|
||||
}
|
Reference in New Issue
Block a user