You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found it strange that I can not use 'delete' or other reserved words as keys to a map. I can see the technical reason behind this decision but it is causing hard to reproduce/debug runtime errors in situations where the map is used in a dynamic way. I got lucky that one of the words that I happened to load dynamically into map was 'delete' purely by chance otherwise I would not have caught this error and now my work around is to always prefix the keys just because of a few reserved keywords.
It would be really nice to allow arbitrary keys.
The text was updated successfully, but these errors were encountered:
there has been some discussion about this regarding the other observ-* modules. if we go for an api change, this is possible. comments on the subject are welcome.
I am thinking it may make sense for map and struct be to different. I don't have an issue with observ-struct but for something that's a map, I am thinking the observed immutable value can just be an immutable map, with only a get(key) and values are not accessible as object properties. ES6 map works this way and potentially when ES6 map is more widely implemented, this can also use it to allow non-string keys as well.
I found it strange that I can not use 'delete' or other reserved words as keys to a map. I can see the technical reason behind this decision but it is causing hard to reproduce/debug runtime errors in situations where the map is used in a dynamic way. I got lucky that one of the words that I happened to load dynamically into map was 'delete' purely by chance otherwise I would not have caught this error and now my work around is to always prefix the keys just because of a few reserved keywords.
It would be really nice to allow arbitrary keys.
The text was updated successfully, but these errors were encountered: