UNPKG

sinch-rtc

Version:

RTC JavaScript/Web SDK

24 lines 715 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FsmTransitions = void 0; const _1 = require("."); class FsmTransitions { constructor() { this.entries = new Array(); this.nullState = new _1.NullState(); } add(from, to, next) { this.entries.push({ from, to, next }); } tryGetNext(from, to, onNewState) { const entry = this.entries.find((e) => e.from == from.sessionState && e.to == to); if (entry) { onNewState(entry.next); return true; } onNewState(this.nullState); return false; } } exports.FsmTransitions = FsmTransitions; //# sourceMappingURL=FsmTransitions.js.map