@ginden/blinkstick-v2
Version:
Improved Blickstick API for Node.js
34 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.combineSync = combineSync;
exports.combine = combine;
const tsafe_1 = require("tsafe");
/**
* @summary Combines multiple synchronous animations into a single iterable.
* @category Animation
*/
function combineSync(...animations) {
(0, tsafe_1.assert)(animations.length > 0, 'At least one animation is required');
return {
[Symbol.iterator]: function* () {
for (const animation of animations) {
yield* animation;
}
},
};
}
/**
* @summary Combines multiple asynchronous animations into a single async iterable.
* @category Animation
*/
function combine(...animations) {
(0, tsafe_1.assert)(animations.length > 0, 'At least one animation is required');
return {
[Symbol.asyncIterator]: async function* () {
for await (const animation of animations) {
yield* animation;
}
},
};
}
//# sourceMappingURL=combine.js.map