From df7f53eb9688654d20949c4cf443bb6c49c7c275 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 13 Sep 2024 11:30:09 -0400 Subject: [PATCH] docs: mention sample and withLatestFrom in each other's docs withLatestFrom and sample are pretty similar: the latter just skips emitting when the sampled observable hasn't emitted anything new. I recently found myself using sample when I should've been using withLatestFrom, and would've benefited from it being linked in the docs. --- packages/rxjs/src/internal/operators/sample.ts | 1 + packages/rxjs/src/internal/operators/withLatestFrom.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/rxjs/src/internal/operators/sample.ts b/packages/rxjs/src/internal/operators/sample.ts index 1ab51251fa..3954e44bbd 100644 --- a/packages/rxjs/src/internal/operators/sample.ts +++ b/packages/rxjs/src/internal/operators/sample.ts @@ -35,6 +35,7 @@ import { noop } from '../util/noop.js'; * @see {@link debounce} * @see {@link sampleTime} * @see {@link throttle} + * @see {@link withLatestFrom} * * @param notifier The `ObservableInput` to use for sampling the * source Observable. diff --git a/packages/rxjs/src/internal/operators/withLatestFrom.ts b/packages/rxjs/src/internal/operators/withLatestFrom.ts index b50274d79a..db1ebb4c79 100644 --- a/packages/rxjs/src/internal/operators/withLatestFrom.ts +++ b/packages/rxjs/src/internal/operators/withLatestFrom.ts @@ -41,6 +41,7 @@ export function withLatestFrom( * ``` * * @see {@link combineLatest} + * @see {@link sample} * * @param inputs An input Observable to combine with the source Observable. More * than one input Observables may be given as argument. If the last parameter is