UNPKG

@rxreact/context

Version:

Dependency-inject an RxJS signal graph into your React components

9 lines (8 loc) 498 B
import { Observable } from "rxjs"; /** * An operator to extract a property from an observable of an object. * Useful for pulling a specific prop from an observable of React props. * @param prop - The name of the object property * @returns - An observable of the object's property */ export declare function getProp<Props, T extends keyof Props>(prop: T): (props$: Observable<Props>, compare?: ((oldValue: Props[T], newValue: Props[T]) => boolean) | undefined) => Observable<Props[T]>;