Skip to content

Commit

Permalink
v.1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
emravoan committed Mar 20, 2023
1 parent 4d8c683 commit e842b6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@emravoan/kontoast",
"version": "1.0.4",
"version": "1.0.5",
"description": "KonToast - Simple JS Toast",
"author": "EM Ravoan",
"license": "MIT",
Expand Down
21 changes: 6 additions & 15 deletions src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,24 @@ export default class KonToast {
elToast.addEventListener('hidden.bs.toast', () => elToast.remove());
}

static success(option = { title: '', text: '', delay: 5000, autohide: true }) {
static success(option: IOption) {
KonToast.show({
...option,
type: 'success',
text: option.text,
title: option.title,
delay: option.delay,
autohide: option.autohide,
});
}

static warning(option = { title: '', text: '', delay: 5000, autohide: true }) {
static warning(option: IOption) {
KonToast.show({
...option,
type: 'warning',
text: option.text,
title: option.title,
delay: option.delay,
autohide: option.autohide,
});
}

static error(option = { title: '', text: '', delay: 5000, autohide: true }) {
static error(option: IOption) {
KonToast.show({
...option,
type: 'error',
text: option.text,
title: option.title,
delay: option.delay,
autohide: option.autohide,
});
}
}

0 comments on commit e842b6a

Please sign in to comment.