mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
39c37e10b9
Summary: New Calendar Test Plan: TODO Reviewers: drew, juan, bengotow Reviewed By: bengotow Subscribers: jackie Differential Revision: https://phab.nylas.com/D2767
17 lines
697 B
JavaScript
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;
|
|
}
|
|
}
|