init project portal web
This commit is contained in:
55
lib/price-plan/store/index.ts
Normal file
55
lib/price-plan/store/index.ts
Normal file
@ -0,0 +1,55 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user