import { ITimelineModel } from '../core/types' ; import { loopOff } from '../core/timeloop' ; import { S_INACTIVE , _ } from '../utils/constants' ; import { all } from '../utils/lists' ; import { CANCEL } from '../actions' ; import { IReducer , IReducerContext } from '../core/types' ; export const cancel = ( model , _data , ctx ) => { all ( model . players , effect => effect . cancel ( ) ) ; model . state = S_INACTIVE ; model . time = _ ; model . round = _ ; model . players = _ ; loopOff ( model . id ) ; ctx . trigger ( CANCEL ) ; } ;