Skip to content

Commit

Permalink
docs: mention sample and withLatestFrom in each other's docs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robintown committed Sep 13, 2024
1 parent f9f07f1 commit df7f53e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/rxjs/src/internal/operators/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions packages/rxjs/src/internal/operators/withLatestFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function withLatestFrom<T, O extends unknown[], R>(
* ```
*
* @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
Expand Down

0 comments on commit df7f53e

Please sign in to comment.