RetailMeNotSandbox / redux-mount-store

Redux store enhancer that makes it possible to mount sub-stores
MIT License
2 stars 3 forks source link

Use tokenized paths to determine unmount ancestors #6

Closed lawnsea closed 8 years ago

lawnsea commented 8 years ago

When asked to unmount a path, we must check if it has any descendant paths and unmount those first. Previously we looked for descendants by checking all mounted paths to see if they started with the path to unmount. Unfortunately, we did this via string comparison, with the result that path10 was considered a descendant of path1.

Instead, split the paths and compare by path segment.

[fix #5]