cyclejs-calendar
v0.1.2
Published
Calendar component for Cycle.js
Downloads
2
Readme
# cyclejs-calendar
Calendar component for Cycle.js
Install
npm install cyclejs-calendar --save
Demo live
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