2018-01-28 21:09:39 +00:00
|
|
|
export function timelineComputations(store) {
|
|
|
|
store.compute('currentTimelineData', ['currentInstance', 'currentTimeline', 'timelines'],
|
|
|
|
(currentInstance, currentTimeline, timelines) => {
|
|
|
|
return ((timelines && timelines[currentInstance]) || {})[currentTimeline] || {}
|
|
|
|
})
|
|
|
|
|
2018-02-04 02:06:02 +00:00
|
|
|
store.compute('timelineItemIds', ['currentTimelineData'], (currentTimelineData) => currentTimelineData.timelineItemIds || [])
|
2018-01-28 21:09:39 +00:00
|
|
|
store.compute('runningUpdate', ['currentTimelineData'], (currentTimelineData) => currentTimelineData.runningUpdate)
|
|
|
|
store.compute('initialized', ['currentTimelineData'], (currentTimelineData) => currentTimelineData.initialized)
|
2018-02-04 02:06:02 +00:00
|
|
|
store.compute('lastTimelineItemId', ['timelineItemIds'], (timelineItemIds) => timelineItemIds.length && timelineItemIds[timelineItemIds.length - 1])
|
2018-01-28 21:09:39 +00:00
|
|
|
}
|