UNPKG

wpilib-riolog

Version:
30 lines 765 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); class PromiseCondition { constructor() { this.hasBeenSet = false; this.condSet = undefined; } wait() { return new Promise((resolve, _) => { this.condSet = () => { resolve(); }; if (this.hasBeenSet === true) { resolve(); } }); } set() { this.hasBeenSet = true; if (this.condSet !== undefined) { this.condSet(); } } reset() { this.condSet = undefined; this.hasBeenSet = false; } } exports.PromiseCondition = PromiseCondition; //# sourceMappingURL=promisecond.js.map