How to use the superfly-timeline.Resolver.resolveAllStates function in superfly-timeline

To help you get started, we’ve selected a few superfly-timeline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nrkno / tv-automation-server-core / meteor / client / ui / TestTools / Timeline.tsx View on Github external
let now = getCurrentTimeReactive()

	try {
		// These properties will be exposed under this.props
		// Note that these properties are reactively recalculated
		let timeline = transformTimeline(
			Timeline.find({
				studioId: props.studioId
			}, { sort: { _id: 1 } }).fetch()
		)

		// console.log('rerun')

		// TODO - dont repeat unless changed
		let tl = Resolver.resolveTimeline(timeline, { time: now })
		let allStates = Resolver.resolveAllStates(tl)

		let state = Resolver.getState(allStates, now)

		return {
			now: now,
			state: state
		}
	} catch (e) {
		return {
			now: now,
			errorMsg: `Failed to update timeline:\n${e}`
		}
	}
})(
class extends MeteorReactComponent {