Skip to content

Commit

Permalink
Update projects/s-rxjs-utils/src/lib/map-with-caching.ts
Browse files Browse the repository at this point in the history
Co-Authored-By: kiramclean <kiramclean@users.noreply.github.com>
  • Loading branch information
ersimont and kiramclean committed Apr 5, 2019
1 parent 171f80c commit f8e43b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/s-rxjs-utils/src/lib/map-with-caching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ObjectWith } from "micro-dash";
import { map } from "rxjs/operators";

/**
* Applies a given function to each value in the array emitted by the source Observable, and emits the resulting array as an Observable. Each item in the array is cached using key generated by the given function so that the resulting arrays contain references to the exact same objects included in the previous emission, when possible.
* Applies a given function to each item in the upstream array and emits the result. Each item is then cached using the key generated by `buildCacheKey` so that the next emission contains references to the matching objects from previous emission, without running `buildDownstreamItem` again. The cache is only held between successive emissions.
*
* @param buildCacheKey A function that converts an upstream object into a string to use as the cache key. Needs to return a unique key for each item in the source array.
* @param buildDownstreamItem A function that converts an upstream object into a downstream object
Expand Down

0 comments on commit f8e43b4

Please sign in to comment.