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
105 lines
3.0 KiB
Plaintext
105 lines
3.0 KiB
Plaintext
import { Observable } from '../Observable';
|
|
import { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';
|
|
import { scheduled } from '../scheduled/scheduled';
|
|
import { innerFrom } from './innerFrom';
|
|
|
|
export function from<O extends ObservableInput<any>>(input: O): Observable<ObservedValueOf<O>>;
|
|
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
|
export function from<O extends ObservableInput<any>>(input: O, scheduler: SchedulerLike | undefined): Observable<ObservedValueOf<O>>;
|
|
|
|
/**
|
|
* Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object.
|
|
*
|
|
* <span class="informal">Converts almost anything to an Observable.</span>
|
|
*
|
|
* 
|
|
*
|
|
* `from` converts various other objects and data types into Observables. It also converts a Promise, an array-like, or an
|
|
* <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable" target="_blank">iterable</a>
|
|
* object into an Observable that emits the items in that promise, array, or iterable. A String, in this context, is treated
|
|
* as an array of characters. Observable-like objects (contains a function named with the ES2015 Symbol for Observable) can also be
|
|
* converted through this operator.
|
|
*
|
|
* ## Examples
|
|
*
|
|
* Converts an array to an Observable
|
|
*
|
|
* ```ts
|
|
* import { from } from 'rxjs';
|
|
*
|
|
* const array = [10, 20, 30];
|
|
* const result = from(array);
|
|
*
|
|
* result.subscribe(x => console.log(x));
|
|
*
|
|
* // Logs:
|
|
* // 10
|
|
* // 20
|
|
* // 30
|
|
* ```
|
|
*
|
|
* Convert an infinite iterable (from a generator) to an Observable
|
|
*
|
|
* ```ts
|
|
* import { from, take } from 'rxjs';
|
|
*
|
|
* function* generateDoubles(seed) {
|
|
* let i = seed;
|
|
* while (true) {
|
|
* yield i;
|
|
* i = 2 * i; // double it
|
|
* }
|
|
* }
|
|
*
|
|
* const iterator = generateDoubles(3);
|
|
* const result = from(iterator).pipe(take(10));
|
|
*
|
|
* result.subscribe(x => console.log(x));
|
|
*
|
|
* // Logs:
|
|
* // 3
|
|
* // 6
|
|
* // 12
|
|
* // 24
|
|
* // 48
|
|
* // 96
|
|
* // 192
|
|
* // 384
|
|
* // 768
|
|
* // 1536
|
|
* ```
|
|
*
|
|
* With `asyncScheduler`
|
|
*
|
|
* ```ts
|
|
* import { from, asyncScheduler } from 'rxjs';
|
|
*
|
|
* console.log('start');
|
|
*
|
|
* const array = [10, 20, 30];
|
|
* const result = from(array, asyncScheduler);
|
|
*
|
|
* result.subscribe(x => console.log(x));
|
|
*
|
|
* console.log('end');
|
|
*
|
|
* // Logs:
|
|
* // 'start'
|
|
* // 'end'
|
|
* // 10
|
|
* // 20
|
|
* // 30
|
|
* ```
|
|
*
|
|
* @see {@link fromEvent}
|
|
* @see {@link fromEventPattern}
|
|
*
|
|
* @param input A subscription object, a Promise, an Observable-like,
|
|
* an Array, an iterable, or an array-like object to be converted.
|
|
* @param scheduler An optional {@link SchedulerLike} on which to schedule the emission of values.
|
|
* @return An Observable converted from {@link ObservableInput}.
|
|
*/
|
|
export function from<T>(input: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T> {
|
|
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
|
|
}
|