-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow someone to access keys #126
Comments
Part of me wonders if we should have our own symbol for this sort of thing. That way we can have generic |
@Bajix was looking for this a few days ago: https://gitter.im/canjs/canjs?at=5859bf21af6b364a29d9a102. |
This should tie in w/ the work for adding define enumerable: #63 Also, here's a use case that we need to address:
It's impossible right now to get a list of all keys that could be serialized. Above is an example of where that would've been extremely relevant |
@Bajix why is it impossible? Doesn't |
That's all keys that are serialized, not that could be serialized. The later would be necessary for simplifying the above use case |
What is the difference between "are serialized" and "could be serialized"? I'm guessing it's because we don't provide |
All serializable keys with values set vs all properties on define that could be set. I was using this for registration - the user password would initially be undefined, hence it wouldn't be part of The __keys event itself is broken. It should either include all keys of enumerable properties regardless of whether they're undefined and emit the __keys event whenever a new key comes into existence, or it should exclusively include keys of properties that are enumerable and defined. At the very least, __keys should be made streamable. Maybe we could add something like |
|
Related to #125
I'm proposing a
keys
method oncan-define
that will work for anycan-define
type object:When reading
keys
, this willObserve.add(this, "__keys")
... things that add new keys should trigger this event.The text was updated successfully, but these errors were encountered: