Closed markuplab closed 8 years ago
Hello @markuplab. You shouldn't do the following:
state.set(['array', { id: 10 }, 'field', value]);
But this:
state.set(['array', { id: 10 }, 'field'], value);
Because your first example is saying: set the whole state to be the array I give you.
But the fact that it is cast to string is weird. Can you build a full use case so I can try to debug it, please?
Sorry, it's error in message.
var tree = new Baobab({
x: [
{ id: 10, hello: 'world' }
]
});
tree.set(['x', { id: 10 }, 'field', 'some'], 'value');
console.log(tree.get());
But this code work correct:
tree.set(['x', { id: 10 }, 'field'], 'value');
Ok, I see now. Thanks @markuplab. Will fix that asap.
This is more profound than I initially thought. Will need some time to fix this.
This should be fixed now. Thanks @markuplab and sorry for the delay.
Hello @Yomguithereal! I have question about
tree.set
/cursor.set
.When we use path with "find" logic, it's convert it to string
'[object_Object]'
and use it as key. It's planned? If planned, i think we must analyze paths with find logic, and work like ittree.get