You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using a schema like this at my project:
{lanes: [{id: 'number',// has to be unique within lanesname: 'string',notes: [{id: 'number',// has to be unique within notestask: 'string',}]}]};
Especially dealing with id uniqueness is a little painful. The ids need to be unique because I need to deal with drag and drop (DnD) and it helps immensely with that.
To get a unique id for a new note I need to do something like this:
This means we would effectively separate order from lanes and notes and flatten the structure. The benefit of this approach is that the lookups I need for DnD become very simple. On downside now we're dealing with id references.
I realized baobab facets could hide some of this detail. This way I could have notes and lanes at root level of the tree. To deal with lane specific notes I would implement a facet that takes lane id and returns notes to render (it would resolve the order based on above). DnD operations would operate on order through facets.
How would you resolve this with baobab? Does the facet approach sound sensible to you?
I am currently using a schema like this at my project:
Especially dealing with id uniqueness is a little painful. The ids need to be unique because I need to deal with drag and drop (DnD) and it helps immensely with that.
To get a unique id for a new note I need to do something like this:
The problem with nested structure is that besides this nasty check lookups across notes become difficult. That's something I need to do in DnD.
After some discussions it was proposed that the structure could be flattened like this:
This means we would effectively separate order from lanes and notes and flatten the structure. The benefit of this approach is that the lookups I need for DnD become very simple. On downside now we're dealing with id references.
I realized baobab facets could hide some of this detail. This way I could have notes and lanes at root level of the tree. To deal with lane specific notes I would implement a facet that takes lane id and returns notes to render (it would resolve the order based on above). DnD operations would operate on order through facets.
How would you resolve this with baobab? Does the facet approach sound sensible to you?
CC @christianalfoni
The text was updated successfully, but these errors were encountered: