Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(StyleObserver): set style properties individually
Fixes #290
- Loading branch information
z-brooks
committed
Jan 23, 2016
1 parent
86722fa
commit 8e9a2eb
Showing
1 changed file
with
29 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8e9a2eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be more appropiate to use a map instead of an array to store the styles?
clearStyles(styles)
could get rid of theincludes
method call, if a map was used instead. That would probably perform better?I don't agree with the naming
clearStyles(styles)
. The name is misleading, as the method isn't clearing the styles provided as argument.8e9a2eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stsje we'll do some performance tuning on this in a future release to minimize array allocations and closures. Take a look at
ClassObserver
for more info.8e9a2eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. So something like https://github.com/z-brooks/binding/blob/master/src/element-observation.js#L50 is preferred?
8e9a2eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow that was quick :) PR please!
8e9a2eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 done.