Part of #19.\n\nThe current sidebar.js sets element.links = JSON.stringify(response) directly on the custom element DOM node. With a Vue SPA the app is self-contained, so a different bridge is needed.\n\nApproach: dispatch a custom DOM event that the Vue app listens for:\n\njs\n// sidebar.js\nfunction onBookmarksRetrieved(response) {\n document.dispatchEvent(\n new CustomEvent('schmackhaft:bookmarks-loaded', {\n detail: JSON.stringify(response)\n })\n )\n}\n\n\nts\n// App.vue (onMounted)\ndocument.addEventListener('schmackhaft:bookmarks-loaded', (e) => {\n store.setLinks(e.detail)\n})\n\n\nThe bookmarksModified handler stays the same (calls refreshBookmarks()).
Part of #19.\n\nThe current
sidebar.jssetselement.links = JSON.stringify(response)directly on the custom element DOM node. With a Vue SPA the app is self-contained, so a different bridge is needed.\n\nApproach: dispatch a custom DOM event that the Vue app listens for:\n\njs\n// sidebar.js\nfunction onBookmarksRetrieved(response) {\n document.dispatchEvent(\n new CustomEvent('schmackhaft:bookmarks-loaded', {\n detail: JSON.stringify(response)\n })\n )\n}\n\n\nts\n// App.vue (onMounted)\ndocument.addEventListener('schmackhaft:bookmarks-loaded', (e) => {\n store.setLinks(e.detail)\n})\n\n\nThebookmarksModifiedhandler stays the same (callsrefreshBookmarks()).