cycle-notification-most-driver

0.0.5 • Public • Published

This is a driver for all your pure-most Cycle apps (think Motorcycle) displays humane.js notifications.

You don't have to include any CSS for humane.js themes, they will be loaded asynchronously from cdnjs.

Install

npm install --save cycle-notification-most-driver

Use

import most from 'most'
import Cycle from '@cycle/most-run'
import {makeNotificationDriver} from 'cycle-notification-most-driver'
 
Cycle.run(app, {
  NOTIFICATION: makeNotificationDriver({
    timeout: 4000,
    baseCls: 'humane-bigbox'
  })
})
 
function app () {
  return {
    NOTIFICATION: most.from([
      'normal notification',
      ['info notification', 'info'],
      ['error notification with custom opts', 'error', {timeout: 8000}],
      ['custom', {addnCls: 'custom-class'}],
      {text: 'this works too', timeout: 1000, clickToClose: true}
    ])
  }
}

Package Sidebar

Install

npm i cycle-notification-most-driver

Weekly Downloads

1

Version

0.0.5

License

MIT

Last publish

Collaborators

  • fiatjaf