22 lines
472 B
TypeScript
22 lines
472 B
TypeScript
import { defineStore } from "pinia";
|
|
import { ref } from "vue";
|
|
import type { PageDataValue } from "#layers/types/api/pageData";
|
|
|
|
export const usePageDataStore = defineStore("pageData", () => {
|
|
const pageData = ref<PageDataValue | null>(null);
|
|
|
|
const setPageData = (response: PageDataValue) => {
|
|
pageData.value = response;
|
|
};
|
|
|
|
const clearPageData = () => {
|
|
pageData.value = null;
|
|
};
|
|
|
|
return {
|
|
pageData,
|
|
setPageData,
|
|
clearPageData,
|
|
};
|
|
});
|