// sharedValueStore.ts
import { defineStore } from 'pinia';

interface SharedState {
    sharedValue: any;
    pageNum: number;
    pageSize: number;
}

export const useSharedValueStore = defineStore('sharedValue', {
    state: (): SharedState => ({
        sharedValue: null,
        pageNum: 1,
        pageSize: 10,
    }),
    actions: {
        updateSharedValue(newValue: any) {
            this.sharedValue = newValue;
        },
        upDatePageNum(newVal: number) {
            this.pageNum = 1;
            this.pageNum = newVal;
        },
        upDatePageSize(newVal: number) {
            this.pageSize = 10;
            this.pageSize = newVal;
        }
    },
});