An open API service indexing awesome lists of open source software.

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

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){
...
}
```