@ng-doc/builder
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
21 lines • 967 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.whenBuildersDone = whenBuildersDone;
const rxjs_1 = require("rxjs");
const types_1 = require("../types");
/**
* Operator function that transforms a source Observable of BuilderState array into an Observable of results array.
* It filters out states that are not done and maps the done states to their results.
* @template T The type of the result.
* @returns {OperatorFunction<Array<BuilderState<T>>, Array<T>>} An OperatorFunction that can be used with pipe.
*/
function whenBuildersDone() {
return (source) => {
return source.pipe(
// Filter out states that are not done.
(0, rxjs_1.filter)((states) => states.every((state) => state instanceof types_1.BuilderDone)),
// Map the done states to their results.
(0, rxjs_1.map)((states) => states.map((state) => state.result)));
};
}
//# sourceMappingURL=when-builders-done.js.map
;