dustingetz / react-cursor

Immutable state for React.js
1.03k stars 50 forks source link

allow refine&set to create key if not existant #92

Closed dustingetz closed 8 years ago

dustingetz commented 8 years ago

Ok I think I like this, having it warn always in this case even though it is legal. Because it will prompt the developer to explicitly specify the key as null or undefined if it is a legal path. But, I think this fix highlights that #38 (default value at subtree) is important, because it would provide a mechanical way to specify that this key is legally null, but also not have to specify all keys of the object up front at initialization, but rather in the component that needs it, much like getInitialState lets us specify default values in the component that needs them.

dustingetz commented 8 years ago

Thank you for the PR. I want to think about it a little more but intend to merge it.