npm

Need private packages and team management tools?Check out npm Orgs. »

cyclejs-calendar

0.1.2 • Public • Published

cyclejs-calendar

Calendar component for Cycle.js

Install

npm install cyclejs-calendar --save

Demo live

Demo live preview

Usage

import Cycle from '@cycle/core';
import {div, makeDOMDriver} from '@cycle/dom';
import {Observable} from 'rx';
import Calendar from 'cyclejs-calendar';
 
function main({DOM}) {
  const calendarProps$ = Observable.of({
    year: 1998, month: 6
  });
 
  const calendar = Calendar({DOM, props$: calendarProps$});
 
  return {
    DOM: Observable.combineLatest(calendar.DOM, calendar.value$,
      (calendarVTree, value) => {
        return div([
          div(value ? value.toString() : 'Pick a date'),
          calendarVTree
        ]);
      })
  };
}
 
Cycle.run(main, {
  DOM: makeDOMDriver('#main-container')
});

License

MIT

install

npm i cyclejs-calendar

Downloadsweekly downloads

0

version

0.1.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability