Files
ocs-portal-web/lib/price-plan/store/index.ts
2025-04-15 13:56:54 +07:00

56 lines
1014 B
TypeScript

import { makeAutoObservable } from "mobx";
class PricePlanStore {
private currentPage = 0;
private size = 10;
private type = "";
private isAlertOpen = false;
private priceplanId = "";
constructor() {
makeAutoObservable(this);
}
getCurrentPage = () => this.currentPage
getSize = () => this.size
getType = () => this.type
getIsAlertOpen = () => this.isAlertOpen
getPricePlanId = () => this.priceplanId
setPricePlanId = (id: string) => {
this.priceplanId = id;
};
setIsAlertOpen = (isOpen: boolean) => {
this.isAlertOpen = isOpen;
};
setCurrentPage = (page: number) => {
this.currentPage = page;
};
setSize = (size: number) => {
this.size = size;
};
setType = (type: string) => {
this.type = type;
};
reset = () => {
this.currentPage = 0;
this.size = 10;
this.type = "";
this.isAlertOpen = false;
this.priceplanId = "";
}
}
const pricePlanStore = new PricePlanStore();
export default pricePlanStore;