https://github.com/ppeeou/alert-window
alert, confirm custom basic
https://github.com/ppeeou/alert-window
alert confirm js
Last synced: over 1 year ago
JSON representation
alert, confirm custom basic
- Host: GitHub
- URL: https://github.com/ppeeou/alert-window
- Owner: ppeeou
- License: mit
- Created: 2018-12-02T11:31:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-02T11:38:33.000Z (over 7 years ago)
- Last Synced: 2025-01-29T19:11:59.839Z (over 1 year ago)
- Topics: alert, confirm, js
- Language: JavaScript
- Homepage: https://ppeeou.github.io/alert-window/
- Size: 44.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alert
This library provides the user with custom alert and confirm functions.
(study, use custom)
example
```
npm run build
npm run server
```
- promise
- async & await
### Promise
Alert
```
AlertWindow
.alert('alert message')
.then(()=> ...)
.catch((error)=> ...)
AlertWindow
.alert({
title:'alert title',
text :'alert text'
})
.then(()=> ...)
.catch((error)=> ...)
```
Confirm
```
AlertWindow
.confirm('confirm message')
.then((isOk)=> {
if(isOk){
...
}else {
...
}
})
.catch((error)=> ...)
AlertWindow
.confirm({
title:'confirm title',
text :'confirm text'
})
.then((isOk)=> {
if(isOk){
...
}else {
...
}
})
.catch((error)=> ...)
```
### Async & await
```
await AlertWindow.alert('alert message')
```
```
const isOk = await AlertWindow.confirm('confirm message')
if(isOk){
...
}
```