Attach and detach entities of a many-to-many relationship
Action: attach
Example:
actionCreators.attach('item', 'i1', 'tagIds', 't1')
Action: detach
Example:
actionCreators.detach('item', 'i1', 'tagIds', 't1')
Demo:
Click on a box. Then click the checkboxes in the opposite column to attach/detach it. Attaching and detaching will change both entities in state.entities
.
Item 1
["t2","t3"]
Item 2
[]
Item 3
[]
Tag 1
[]
Tag 2
["i1"]
Tag 3
["i1"]