Yomguithereal / baobab

JavaScript & TypeScript persistent and optionally immutable data tree with cursors.
MIT License
3.15k stars 117 forks source link

Specify path via dot notation string instead of array #415

Closed TomKaltz closed 8 years ago

TomKaltz commented 8 years ago

Instead of

var newData = cursor.set(['one', 'two'], 'world');

Would be nice to be able to...

var newData = cursor.set('one.two', 'world');

using a library such as https://github.com/sindresorhus/dot-prop or something similar.

Yomguithereal commented 8 years ago

Hello @TomKaltz. I am not very fond of the dot notation because you have to find some way to escape the dot in case a user wants to use a dot within one of its keys. Let me think about it some more.

Yomguithereal commented 8 years ago

I won't go this way for the time being. Too much users using . in some conventions for property names.

PFight commented 7 years ago

May be as an option, disabled by default? I have just read about baobab, these arrays are pretty confusing for a newbie.