What is the correct way to make the result of a filtering+mapping operation on an array reactive?
return store.productTreeData .filter(e => e.parentId == parentId) .map(e => { const children = ... return { productTreeItem: e, children: children.length > 0 ? children : null }; });
return store.productTreeData .filter(e => e.parentId == parentId) .map(e => { const children = ... return { productTreeItem: e, children: children.length > 0 ? children : null }; });
What should I write instead of the object literal? What I would like to do is to refactor some code to separate functions but the result to remain "reactive".