-
Notifications
You must be signed in to change notification settings - Fork 178
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
getters and setters for memorize/active/params? Object.freeze by default? #51
Comments
keep as is. My autocomplete works ;) |
The getters/setters would be just for these 3 properties: changed.memorize(true);
changed.active(true);
changed.defaultArguments(123, 456); They aren't that common tho... just putting the thoughts out there so in the future we remind why it wasn't coded like this and what I was thinking at the time... Outside feedback is great for putting these things in perspective. |
ahh, forgot to say.. another option would be add a "flag" to signals to toggle the behavior, something like a |
Sounds like you are on the right track but just wanted to add another outside perspective's concern for performance hits. :) (Even if v8 ameliorates performance hits that doesn't help other browsers' JS engines) |
closing this in favor of #60 |
I kinda regret of using normal properties instead of getter/setters because JS doesn't complain when we try to set a property that doesn't exist -
signal.memoize = true;
will be extremely hard to spot (missingr
).It could be fixed by "use strict" +
Object.freeze()
on ES5:I heard that
Object.freeze
have some perf impact on V8 but that should be fixed soon.One option would be to freeze the Signal and SignalBinding automatically during the instantiation but that might prevent users from adding custom behavior to a Signal instance (will reduce the flexibility).
My current opinion is that we should leave it as is to keep backwards compatibility and maybe do getters/setters for a v2.0 release.
The text was updated successfully, but these errors were encountered: