I have two big arrays in the store: categories and bookmarks.
const categories = [
{
id: 1,
bookmarks: [1, 2],
title: 'Category',
}
]
const bookmarks = [
{
id: 1,
category: 1,
title: 'Bookmark',
}
]
I had to normalize these two, in order to work propably with vuex. Previously, I had the actual bookmarks object in category.bookmarks
.
On the bookmarks page I have one active category, whose bookmarks should be displayed. So I read the active category from store and then I get its bookmarks via getCategoryBookmarks(). This method maps all store.bookmarks to the category via bookmarkId.
So far so good. When I remove a bookmark from store, the view gets updated. But when I add a bookmark the view wont get updated. I have to reload the whole page to display it.