nice-ui
Version:
React design system, components, and utilities
25 lines (24 loc) • 849 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToastService = void 0;
const ToastStack_1 = require("./ToastStack");
class ToastService {
constructor() {
this.topLeft = new ToastStack_1.ToastStack();
this.topRight = new ToastStack_1.ToastStack();
this.bottomLeft = new ToastStack_1.ToastStack();
this.bottomRight = new ToastStack_1.ToastStack();
this.add = (opts) => {
const stack = (opts.right ?? true)
? (opts.bottom ?? true)
? this.bottomRight
: this.topRight
: (opts.bottom ?? true)
? this.bottomLeft
: this.topLeft;
const item = stack.add(opts);
return item;
};
}
}
exports.ToastService = ToastService;
;