-
Notifications
You must be signed in to change notification settings - Fork 25
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
Link to ES6 object does not work #17
Comments
It's the feature. When Therefore, no classes as state members are supported. As this is not the way to go in a large application, we're at Verizon/Volicon are not using NestedLink alone, but as a part of NestedReact. Which replaces React's state with observable and serializable classes. https://github.com/Volicon/NestedReact Here is an example. In order to get ES6 classes syntax you need to use "rc" version. It will be released soon. https://github.com/Volicon/NestedReact/tree/develop/examples/checklistTree |
As an alternative, it is possible to create the fork of NestedLink to support immutable classes. The easiest way to go is to add your own "helper". Put it in the third option to the switch (note that built-ins like Date should still go through the dummyHelper). Here: Helper is a combination of I would just forward these operations to the object in your helper, and created the base class with such an operation. Generic "clone" operation can be implemented in the base class like this: clone(){
const copy = new this.constructor();
Object.assign( copy, this );
return copy;
} In simple cases, it should work just fine. |
ok. Thank you. |
Following code do this. You can add car to the list of cars. You can change manufacturer name. When I have defined items in state as ES6 classes then I cannot change the manufacturer name. With literal objects everything works fine. Is this bug or I do something wrong?
The text was updated successfully, but these errors were encountered: