-
Notifications
You must be signed in to change notification settings - Fork 398
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
behaviour of ractive.toggle('foo.*.bar')
#1604
Labels
Comments
I think it makes the most sense (and I think this how I thought of it in my mind) for wildcard keypaths to act like a console.log( ractive.get( 'foo' ) ); // -> [ { bar: true }, { bar: false }, { bar: true } ]
ractive.toggle( 'foo.*.bar' );
console.log( ractive.get( 'foo' ) ); // -> [ { bar: false }, { bar: true }, { bar: false } ] |
I think it should, if one assumes that Wild question: What happens if |
Rich-Harris
added a commit
that referenced
this issue
Mar 10, 2015
Allow wildcards to be used with ractive.toggle(), ractive.add() and ractive.subtract()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This SO question raises an interesting point: should
ractive.toggle()
, if used with a keypath pattern likefoo.*.bar
, toggle all the keypaths that match that pattern?At present, it's just a simple wrapper around
ractive.set()
:Possibly a niche use case but it does break expectations. The
ractive.add()
andractive.subtract()
convenience methods are in the same boat, though that's even more niche.The text was updated successfully, but these errors were encountered: