Skip to content

feat: allow to use signals to get breakpoints #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

tutkli
Copy link
Owner

@tutkli tutkli commented Aug 5, 2024

Previously only straight breakpoint keys could be used to get breakpoints. This change allows to use keys, signals or functions to get the breakpoints.

Usage:

private breakpoints = observeBreakpoints(breakpointsTailwind);

// Could be any type of Signal (signal, computed, input...)
public signalBreakpoint = signal<keyof typeof breakpointsTailwind>("sm")
public isSmallerOrEqual = this.breakpoints.smallerOrEqual(this.signalBreakpoint) // we use the signal without calling the value

Fixes #1

@tutkli tutkli changed the base branch from master to next August 5, 2024 20:32
@tutkli tutkli merged commit 19b3dc3 into next Aug 5, 2024
5 checks passed
@tutkli tutkli mentioned this pull request Aug 5, 2024
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using breakpoint functions that return Signal (smaller, greater, etc.) causes error NG0602
1 participant