import { action, makeObservable, observable } from 'mobx';
export class ToastState {
    constructor() {
        this.configs = observable.array([], {
            deep: false,
        });
        makeObservable(this, {
            showToast: action.bound,
            remove: action.bound,
        });
    }
    remove(config) {
        this.configs.remove(config);
    }
    showToast(config) {
        this.configs.push(config);
        return {
            remove: () => {
                this.configs.remove(config);
            },
        };
    }
}
//# sourceMappingURL=ToastState.js.map