/**
 * This is a stop-gap an differential update can be put in place
 */ import { ITimelineModel , IReducerContext } from '../core/types' ; import { pause } from './pause' ; import { play } from './play' ; import { S_PAUSED , S_PLAYING , _ } from '../utils/constants' ; import { all } from '../utils/lists' ; export function rebuild ( model , ctx ) { const state = model . state ; all ( model . players , p => p . cancel ( ) ) ; model . players = _ ; switch ( state ) { case S_PAUSED : pause ( model , _ , ctx ) ; break ; case S_PLAYING : play ( model , _ , ctx ) ; break ; } }