UNPKG

just-animate

Version:
14 lines (13 loc) 414 B
import { loopOff } from '../core/timeloop'; import { S_INACTIVE, _ } from '../utils/constants'; import { all } from '../utils/lists'; import { CANCEL } from '../actions'; 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); };