Mailspring/internal_packages/N1-Scheduler/lib/calendar/proposed-time-calendar-data-source.es6
Evan Morikawa 39c37e10b9 feat(calendar): add week view for quick scheduler
Summary: New Calendar

Test Plan: TODO

Reviewers: drew, juan, bengotow

Reviewed By: bengotow

Subscribers: jackie

Differential Revision: https://phab.nylas.com/D2767
2016-04-04 15:05:48 -07:00

17 lines
697 B
JavaScript

import Rx from 'rx-lite'
import {CalendarDataSource} from 'nylas-exports'
import ProposedTimeCalendarStore from '../proposed-time-calendar-store'
export default class ProposedTimeCalendarDataSource extends CalendarDataSource {
buildObservable({startTime, endTime}) {
const $events = super.buildObservable({startTime, endTime});
const $proposedTimes = Rx.Observable.fromStore(ProposedTimeCalendarStore)
.map((store) => store.timeBlocksAsEvents())
const $obs = Rx.Observable.combineLatest([$events, $proposedTimes])
.map(([calEvents, proposedTimes]) => {
return {events: calEvents.concat(proposedTimes)}
})
this.observable = $obs;
return $obs;
}
}