-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
Implement silent update functionality for objects as well as individual values.
Doesn't this already exist? I see tests for this too |
http://jsfiddle.net/Neogavin/3WPYS/5/ Here's a jsfiddle that shows the problem exactly. If you set/update using an object, the silent flag is ignored. |
Hey Neogavin, thanks for your pull request! Right now the |
That's how I'm currently using it on my project. I just think it'd be more consistent for the silent flag to always work, and not just in the case of setting/pushing/removing/updating one attribute. And its a small enough change that I could literally do it in a few minutes and commit it. I can understand it not seeming like a very big use case right now, but this was something that threw me off for a while, and I am using it in a production environment, so I'm sure someone else will want this feature added in at some point. I could submit another pull request with the change already in it if needed. |
I agree with @Neogavin it seems like inconsistent behavior for set to not obey the silent flag in a case as standard as this. If you want to initialize a bunch of properties on init but don't want it to trigger a bunch of events off (which seems like it is what you would want to do) it seems like overkill to write a bunch of .set calls instead of one |
Added in chaining functionality for on/off events. Just returns the Stapes.subclass when you set an event to on/off.
Oh, shoot, that last commit was an error, I put it on the wrong branch. |
That was my mistake.
Okay, the use case seems legit, and i agree that it's probably easy to implement. However, i'll only accept a pull request if:
I'll be closing this PR for now, if you got something, please open a new one. I'm looking forward to your contributions and thanks for all your comments on Stapes! |
Well, i was a little harsh last time, it didn't actually take the time i thought to code it, so i rolled in silent functionality for objects in |
Been using Stapes for a project here at work, and was wondering why this wasn't a feature already: Implement silent set functionality for objects as well as individual values.
Because sometimes, I want to update a model without having it notify everything else right away.
Also showed an alternative way to handle the silent flag existing or not.