notier
v1.1.0
Published
Simple promise enabled wrapper around notification library notie.
Downloads
2
Readme
notier
Simple promise enabled wrapper around notification library notie.
Install
$ npm i -S notier
# or
$ yarn add notier
Use
var notier = require('notier')
// general notifier
notier('Hi there!')
// success type notification
notier.success('Item acquired successfully')
// error type notification
notier.error('Could not find any results!' )
// confirm
notier.confirm('Are you sure? This cannot be undone.')
.then(data => {
// user accepted
})
.catch(() => {
// user rejected
})
API
notier(message, opts)message
is self explanatory. opts
is notie options. Returns promise.
notier.info(message, opts)
Info type notification.
notier.success(message, opts)
Success type notification.
notier.warning(message, opts)
Warning type notification.
notier.error(message, opts)
Error type notification.
notier.confirm(message, opts)
Confirm notification. Returned promise will resolve on accept.
notier.setTexts({ submit, cancel })
Set global texts to be used in actions.
Author
Ismail Demirbilek - @dbtek