Skip to content

Vue migration: Create Pinia bookmarks store #24

@exhuma

Description

@exhuma

Part of #19.\n\nCreate src/store/bookmarks.ts as a Pinia store that wraps the plain Links class in Vue reactivity.\n\nts\nimport { defineStore } from 'pinia'\nimport { reactive } from 'vue'\nimport { Links } from '../core/links'\n\nexport const useBookmarksStore = defineStore('bookmarks', () => {\n const links = reactive(new Links())\n\n function setLinks(json: string) {\n const loaded = Links.fromJson(json)\n links.links = loaded.links\n links.searchedTags = []\n links.searchString = ''\n }\n\n return { links, setLinks }\n})\n\n\nsidebar.js will call setLinks after retrieving bookmarks from the background page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions