intelie / immutable-js-diff

MIT License
261 stars 32 forks source link

Ignore path #22

Open giuseppepaul opened 7 years ago

giuseppepaul commented 7 years ago

Just wondering if there's any recommended way of ignoring certain paths? I'm using diff and patch which are both great, but I have nested maps at certain points in the structure that I'd like to never be changed by the patch.

Without changing the structure of my data, my current idea is just to run the diff and then filter out anything with a specified name, say "_ignore" in the path, then patch from there.

Only problem with this is if I have a bunch of changes inside my "_ignore" then it's going to hurt performance, so it'd obviously be better to have diff ignore those if possible.

Appreciate any thoughts / help.

Thanks