You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great of a harness could also be loaded within a specific component instead of the document root. Now I've added myself two methods but it would of course be better if its included in the package. My code at the moment:
export function getHarnessForComponent<HARNESS extends ComponentHarness, COMPONENT extends ContentContainerComponentHarness<string>>(
query: HarnessQuery<HARNESS>, component: ChainableHarness<COMPONENT>
): ChainableHarness<HARNESS> {
return new Proxy<ChainableHarness<HARNESS>>({} as any, {
get: (_, prop) =>
(addHarnessMethodsToChainer(component.getHarness(query) as ChainableHarness<HARNESS>) as any)[prop],
});
}
export function getAllHarnessesForComponent<HARNESS extends ComponentHarness, COMPONENT extends ContentContainerComponentHarness<string>>(
query: HarnessQuery<HARNESS>, component: ChainableHarness<COMPONENT>
): ChainableHarness<HARNESS[]> {
return new Proxy<ChainableHarness<HARNESS[]>>({} as any, {
get: (_, prop) => (component.getAllHarnesses(query) as any as ChainableHarness<HARNESS[]> as any)[prop],
});
}
The text was updated successfully, but these errors were encountered:
It would be great of a harness could also be loaded within a specific component instead of the document root. Now I've added myself two methods but it would of course be better if its included in the package. My code at the moment:
The text was updated successfully, but these errors were encountered: