forked from trent_larson/crowd-funder-for-time-pwa
21 lines
477 B
TypeScript
21 lines
477 B
TypeScript
// @ts-check
|
|
import { defineStore } from "pinia";
|
|
|
|
export const useAppStore = defineStore({
|
|
id: "app",
|
|
state: () => ({
|
|
_projectId:
|
|
typeof localStorage.getItem("projectId") === "undefined"
|
|
? ""
|
|
: localStorage.getItem("projectId"),
|
|
}),
|
|
getters: {
|
|
projectId: (state): string => state._projectId as string,
|
|
},
|
|
actions: {
|
|
async setProjectId(newProjectId: string) {
|
|
localStorage.setItem("projectId", newProjectId);
|
|
},
|
|
},
|
|
});
|