Testing some higher order functions with abortability

Unit Tests

Get size of this image

Tip: Throttle network speed to Slow 3G

ms
ms
ms

Logging:

Other higher order functions

  • withDebounce: Only execute request if no new request within X ms

  • withQueue: Place requests in a queue so they can not execute simultaneous. The requests will be execute one after each other with an optional delay (example: Google Buckets allows only 1 update per second)

  • withCombine: To reduce multiple requests to the same URL, delay first request and collect inputs of the requests to the same url, if delay passes we merge the collected inputs and execute 1 fetch request. When request returns we extract the response for each requested fetch and resolve them.
    Example: GetLabels(keys: readonly string[]): Promise<string[]>. (This is not possible for all signatures.)