Closed
Description
I have a scenario where the breakpoint is dynamic and I pass it as an input to my component. Therefore, I cannot call the breakpoint functions at the root level – I have to call them within another computed
signal or within effect
.
private breakpoints = observeBreakpoints(breakpointsTailwind);
private worksFine = this.breakpoints.smallerOrEqual("md");
// The problem 👇
private doesNotWork = computed<boolean>(() => {
const signal = this.breakpoints.smallerOrEqual(this.inputBreakpoint());
return signal();
});
public inputBreakpoint = input<"sm" | "md" | "lg" | "xl" | "2xl">("sm");
However, this causes this error
REPRO
Try to run the app, and check the console
I suppose the only way to solve this issue is to pass the injection context to either the breakpoint function or to the observeBreakpoints
P.S. Many thanks for this library, the usage is elegant and straightforward. I am more than happy to contribute.
Metadata
Metadata
Assignees
Labels
No labels