cycle-humanejs-driver
v0.0.1
Published
Display growl-like notifications from a Cycle app.
Downloads
8
Maintainers
Readme
humane-js notifications for your Cycle app.
npm install --save cycle-humanejs-driver
<head>
<link href=https://cdnjs.cloudflare.com/ajax/libs/humane-js/3.2.2/themes/flatty.min.css rel=stylesheet>
</head>
// cycle instantiation
var makeNotificationDriver = require('cycle-humanejs-driver')
drivers = {
DOM: ...,
HTTP: ...,
NOTIFICATION: makeNotificationDriver({timeout: 8000 /* settings passed directly to humane-js */ })
}
// inside the cycle component
return {
DOM: ...,
HTTP: ...,
NOTIFICATION: Rx.Observable.from([
'simple notification',
['success notification', 'success'],
['error notification', 'error'],
['custom notification', {addnCls: 'my-notification-class' /* object passed directly to humane-js */ }]
])
}
It requires the flatty theme to work with 'error'
, 'success'
and 'info'
shortcuts, but you can use other themes with the custom notification and explicitly setting the class.