drborges / arbor-store

Seamless state management made with ❤️
https://github.com/drborges/arbor-store
8 stars 0 forks source link

Nodes must have their path refreshed #54

Open drborges opened 6 years ago

drborges commented 6 years ago

A GIF is worth 10000 words...

2018-04-10 20 28 45

Basically, a node bound to path /array/:index must have its path refreshed when items removed/added to the array affect the path.

Example:

const todos = [
  { id: 1, ... }, // path = /todos/0
  { id: 2, ... }, // path = /todos/1
]

When removing todos[0], the path of the remaining todo, shoud no longer be /todos/1 but rather /todos/0.