Skip to content

Instantly share code, notes, and snippets.

View ctollerud's full-sized avatar

Corey Tollerud ctollerud

View GitHub Profile
@mold
mold / combine-latest-to-object.ts
Last active August 21, 2022 20:46
An rxjs combineLatest that takes an object of key/observable pairs and emits an object of key/values when any of the inner observables emits (typescript).
import { combineLatest, noop, Observable } from 'rxjs';
import { debounceTime, map, shareReplay, startWith, tap } from 'rxjs/operators';
export interface OperatorDict<X> {
[key: string]: Observable<X> | [Observable<X>, X];
}
/**
* Extracts the type `T` of an `Observable<T>`
*/