Skip to content
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

[css-typed-om] Add .update() to styleMap #353

Closed
tabatkins opened this issue Feb 3, 2017 · 1 comment
Closed

[css-typed-om] Add .update() to styleMap #353

tabatkins opened this issue Feb 3, 2017 · 1 comment

Comments

@tabatkins
Copy link
Member

Per Seattle resolution, we should add a .update() method to styleMap, which takes a key and a callback, passing the value to the callback and setting the key to the return value. This is a convenience API to make it easier to mutate things without having to repeat yourself.

(There was discussion about this making things more performant, as you only need one cache lookup, but Daniel Ehrenburg pointed out that you can mutate the map in the callback, so you can't rely on the cache lookup remaining valid.)

@shans
Copy link
Contributor

shans commented Feb 4, 2017

Fixed by f9a8e09.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants