-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request
Context
I have a signals "map" that has multiple fields like
{
Name: { Value: "stuff", Touched: false },
Email: { Value: "email@email.com", Touched: true },
...
}
I would like to toggle all .Touched
signals.
I could rewrite so the touched signals live outside of that, but was wondering the following:
Proposal
As of now, the @setAll
and @toggleAll
actions work on the prefix of the path of signal.
If we need to @setAll(/.*\.touched/, true)
, then it is not working.
Writing it like that is actually really not pleasant 🤔 , and maybe that feature request might be a bad idea, but still, I'll leave you to decide!
We could rewrite the setAll
/ toggleAll
to accept either a string, or a regex.
The string would continue as-is. typeof prefix === 'string'
The regex would crush the world. typeof prefix === 'object'
WDYT?
Datastar Version
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request