0.0.5 • Published 8 years ago

cycle-notification-most-driver v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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}
    ])
  }
}