TenantAtlas/apps/platform/.pnpm-store/v10/files/8a/e324f9e8497015f1ac101f64f187925faf5e58d2cd02473ac493fb17e0201ffc519e510c63b1e6c0ad50404d3914bb2df1e39c2f589874aaa676345e58546c
ahmido 1fec9c6f9d
Some checks failed
Main Confidence / confidence (push) Failing after 45s
feat: compress governance operator outcomes (#253)
## 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
2026-04-19 12:30:36 +00:00

82 lines
2.4 KiB
Plaintext

import { Observable } from '../Observable';
import { ObservableInput } from '../types';
/**
* Checks a boolean at subscription time, and chooses between one of two observable sources
*
* `iif` expects a function that returns a boolean (the `condition` function), and two sources,
* the `trueResult` and the `falseResult`, and returns an Observable.
*
* At the moment of subscription, the `condition` function is called. If the result is `true`, the
* subscription will be to the source passed as the `trueResult`, otherwise, the subscription will be
* to the source passed as the `falseResult`.
*
* If you need to check more than two options to choose between more than one observable, have a look at the {@link defer} creation method.
*
* ## Examples
*
* Change at runtime which Observable will be subscribed
*
* ```ts
* import { iif, of } from 'rxjs';
*
* let subscribeToFirst;
* const firstOrSecond = iif(
* () => subscribeToFirst,
* of('first'),
* of('second')
* );
*
* subscribeToFirst = true;
* firstOrSecond.subscribe(value => console.log(value));
*
* // Logs:
* // 'first'
*
* subscribeToFirst = false;
* firstOrSecond.subscribe(value => console.log(value));
*
* // Logs:
* // 'second'
* ```
*
* Control access to an Observable
*
* ```ts
* import { iif, of, EMPTY } from 'rxjs';
*
* let accessGranted;
* const observableIfYouHaveAccess = iif(
* () => accessGranted,
* of('It seems you have an access...'),
* EMPTY
* );
*
* accessGranted = true;
* observableIfYouHaveAccess.subscribe({
* next: value => console.log(value),
* complete: () => console.log('The end')
* });
*
* // Logs:
* // 'It seems you have an access...'
* // 'The end'
*
* accessGranted = false;
* observableIfYouHaveAccess.subscribe({
* next: value => console.log(value),
* complete: () => console.log('The end')
* });
*
* // Logs:
* // 'The end'
* ```
*
* @see {@link defer}
*
* @param condition Condition which Observable should be chosen.
* @param trueResult An Observable that will be subscribed if condition is true.
* @param falseResult An Observable that will be subscribed if condition is false.
* @return An observable that proxies to `trueResult` or `falseResult`, depending on the result of the `condition` function.
*/
export declare function iif<T, F>(condition: () => boolean, trueResult: ObservableInput<T>, falseResult: ObservableInput<F>): Observable<T | F>;
//# sourceMappingURL=iif.d.ts.map