Some checks failed
Main Confidence / confidence (push) Failing after 45s
## Summary - introduce surface-aware compressed governance outcomes and reuse the shared truth/explanation seams for operator-first summaries - apply the compressed outcome hierarchy across baseline, evidence, review, review-pack, canonical review/evidence, and artifact-oriented operation-run surfaces - expand spec 214 fixtures and Pest coverage, and fix tenant-panel route assertions by generating explicit tenant-panel URLs in the affected Filament tests ## Validation - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - focused governance compression suite from `specs/214-governance-outcome-compression/quickstart.md` passed (`68` tests, `445` assertions) - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/InventoryItemResourceTest.php tests/Feature/Filament/BackupSetUiEnforcementTest.php tests/Feature/Filament/RestoreRunUiEnforcementTest.php` passed (`18` tests, `81` assertions) Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #253
62 lines
2.5 KiB
Plaintext
62 lines
2.5 KiB
Plaintext
import { Observable } from '../Observable';
|
|
import { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';
|
|
import { from } from './from';
|
|
import { identity } from '../util/identity';
|
|
import { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';
|
|
import { popResultSelector, popScheduler } from '../util/args';
|
|
import { createObject } from '../util/createObject';
|
|
import { createOperatorSubscriber } from '../operators/OperatorSubscriber';
|
|
import { executeSchedule } from '../util/executeSchedule';
|
|
export function combineLatest(...args) {
|
|
const scheduler = popScheduler(args);
|
|
const resultSelector = popResultSelector(args);
|
|
const { args: observables, keys } = argsArgArrayOrObject(args);
|
|
if (observables.length === 0) {
|
|
return from([], scheduler);
|
|
}
|
|
const result = new Observable(combineLatestInit(observables, scheduler, keys
|
|
?
|
|
(values) => createObject(keys, values)
|
|
:
|
|
identity));
|
|
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
|
|
}
|
|
export function combineLatestInit(observables, scheduler, valueTransform = identity) {
|
|
return (subscriber) => {
|
|
maybeSchedule(scheduler, () => {
|
|
const { length } = observables;
|
|
const values = new Array(length);
|
|
let active = length;
|
|
let remainingFirstValues = length;
|
|
for (let i = 0; i < length; i++) {
|
|
maybeSchedule(scheduler, () => {
|
|
const source = from(observables[i], scheduler);
|
|
let hasFirstValue = false;
|
|
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
values[i] = value;
|
|
if (!hasFirstValue) {
|
|
hasFirstValue = true;
|
|
remainingFirstValues--;
|
|
}
|
|
if (!remainingFirstValues) {
|
|
subscriber.next(valueTransform(values.slice()));
|
|
}
|
|
}, () => {
|
|
if (!--active) {
|
|
subscriber.complete();
|
|
}
|
|
}));
|
|
}, subscriber);
|
|
}
|
|
}, subscriber);
|
|
};
|
|
}
|
|
function maybeSchedule(scheduler, execute, subscription) {
|
|
if (scheduler) {
|
|
executeSchedule(subscription, scheduler, execute);
|
|
}
|
|
else {
|
|
execute();
|
|
}
|
|
}
|
|
//# sourceMappingURL=combineLatest.js.map |