intelie / immutable-js-diff

MIT License
260 stars 32 forks source link

Should path be an array? #3

Open skrat opened 9 years ago

skrat commented 9 years ago

I find it pointless to concat and stringify the path, because if one wants to use it (eg. in a getIn call), it has to be parsed. What's the point of having it as string? Yes I do some pattern matching now, using regular expressions, but even that would be faster and more convenient if path would be an array of actual keys.

pedroteixeira commented 9 years ago

Right now, for us, it's more convenient that .toJSON() is compatible to the json patch spec, which adopts json pointer strings rather than arrays: https://tools.ietf.org/html/rfc6902

Will talk about it, perhaps could be an options to the diff function.

NodeGuy commented 7 years ago

You may prefer this fork: https://github.com/tgriesser/immutable-diff

pedroteixeira commented 7 years ago

nice! perhaps we could eventually have a single code base, and an API to support both return types