"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.ToastState = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _mobx = require("mobx");
class ToastState {
  constructor() {
    (0, _defineProperty2.default)(this, "configs", _mobx.observable.array([], {
      deep: false
    }));
    (0, _mobx.makeObservable)(this, {
      showToast: _mobx.action.bound,
      remove: _mobx.action.bound
    });
  }
  remove(config) {
    this.configs.remove(config);
  }
  showToast(config) {
    this.configs.push(config);
    return {
      remove: () => {
        this.configs.remove(config);
      }
    };
  }
}
exports.ToastState = ToastState;
//# sourceMappingURL=ToastState.js.map