diff --git a/snippets/javascript.json b/snippets/javascript.json index 7df4d05..4aa3b31 100644 --- a/snippets/javascript.json +++ b/snippets/javascript.json @@ -935,6 +935,28 @@ ], "description": "just a word" }, + "newPiniaStore": { + "prefix": "newPiniaStore", + "body": [ + "import { defineStore, acceptHMRUpdate } from \"pinia\";", + "", + "export const use$TM_FILENAME_BASE = defineStore(\"$TM_FILENAME_BASE\", {", + " state: () => {", + " return {", + " $0", + " };", + " },", + " getters: {},", + " actions: {},", + "});", + "", + "if (import.meta.hot) {", + " import.meta.hot.accept(acceptHMRUpdate(use$TM_FILENAME_BASE, import.meta.hot));", + "}", + "" + ], + "description": "Bootstrap the code needed for a Vue.js Pinia store file" + }, "newVuexStore": { "prefix": "newVuexStore", "body": [