UNPKG

rimmel

Version:

A Stream-Oriented UI library for the Rx.Observable Universe

15 lines (12 loc) 473 B
import { pipe, withLatestFrom, map, from, of } from 'rxjs'; import { curry } from '../utils/curry.js'; const maybeLift = (v) => v.subscribe ? v : v.then ? from(v) : of(v); /** * WIP: don't use yet * Emits the latest value coming from the supplied observable */ const AsLatestFrom = (source, target) => curry(pipe(withLatestFrom(maybeLift(source)), map(([_, source]) => source)), target); export { AsLatestFrom }; //# sourceMappingURL=as-latest-from.js.map