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
95 lines
3.7 KiB
Plaintext
95 lines
3.7 KiB
Plaintext
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
|
import { map } from './map';
|
|
import { innerFrom } from '../observable/innerFrom';
|
|
import { operate } from '../util/lift';
|
|
import { mergeInternals } from './mergeInternals';
|
|
import { isFunction } from '../util/isFunction';
|
|
|
|
/* tslint:disable:max-line-length */
|
|
export function mergeMap<T, O extends ObservableInput<any>>(
|
|
project: (value: T, index: number) => O,
|
|
concurrent?: number
|
|
): OperatorFunction<T, ObservedValueOf<O>>;
|
|
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
export function mergeMap<T, O extends ObservableInput<any>>(
|
|
project: (value: T, index: number) => O,
|
|
resultSelector: undefined,
|
|
concurrent?: number
|
|
): OperatorFunction<T, ObservedValueOf<O>>;
|
|
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
export function mergeMap<T, R, O extends ObservableInput<any>>(
|
|
project: (value: T, index: number) => O,
|
|
resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R,
|
|
concurrent?: number
|
|
): OperatorFunction<T, R>;
|
|
/* tslint:enable:max-line-length */
|
|
|
|
/**
|
|
* Projects each source value to an Observable which is merged in the output
|
|
* Observable.
|
|
*
|
|
* <span class="informal">Maps each value to an Observable, then flattens all of
|
|
* these inner Observables using {@link mergeAll}.</span>
|
|
*
|
|
* 
|
|
*
|
|
* Returns an Observable that emits items based on applying a function that you
|
|
* supply to each item emitted by the source Observable, where that function
|
|
* returns an Observable, and then merging those resulting Observables and
|
|
* emitting the results of this merger.
|
|
*
|
|
* ## Example
|
|
*
|
|
* Map and flatten each letter to an Observable ticking every 1 second
|
|
*
|
|
* ```ts
|
|
* import { of, mergeMap, interval, map } from 'rxjs';
|
|
*
|
|
* const letters = of('a', 'b', 'c');
|
|
* const result = letters.pipe(
|
|
* mergeMap(x => interval(1000).pipe(map(i => x + i)))
|
|
* );
|
|
*
|
|
* result.subscribe(x => console.log(x));
|
|
*
|
|
* // Results in the following:
|
|
* // a0
|
|
* // b0
|
|
* // c0
|
|
* // a1
|
|
* // b1
|
|
* // c1
|
|
* // continues to list a, b, c every second with respective ascending integers
|
|
* ```
|
|
*
|
|
* @see {@link concatMap}
|
|
* @see {@link exhaustMap}
|
|
* @see {@link merge}
|
|
* @see {@link mergeAll}
|
|
* @see {@link mergeMapTo}
|
|
* @see {@link mergeScan}
|
|
* @see {@link switchMap}
|
|
*
|
|
* @param project A function that, when applied to an item emitted by the source
|
|
* Observable, returns an Observable.
|
|
* @param concurrent Maximum number of `ObservableInput`s being subscribed to concurrently.
|
|
* @return A function that returns an Observable that emits the result of
|
|
* applying the projection function (and the optional deprecated
|
|
* `resultSelector`) to each item emitted by the source Observable and merging
|
|
* the results of the Observables obtained from this transformation.
|
|
*/
|
|
export function mergeMap<T, R, O extends ObservableInput<any>>(
|
|
project: (value: T, index: number) => O,
|
|
resultSelector?: ((outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R) | number,
|
|
concurrent: number = Infinity
|
|
): OperatorFunction<T, ObservedValueOf<O> | R> {
|
|
if (isFunction(resultSelector)) {
|
|
// DEPRECATED PATH
|
|
return mergeMap((a, i) => map((b: any, ii: number) => resultSelector(a, b, i, ii))(innerFrom(project(a, i))), concurrent);
|
|
} else if (typeof resultSelector === 'number') {
|
|
concurrent = resultSelector;
|
|
}
|
|
|
|
return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent));
|
|
}
|