From 1de4031d9cb4c39020bf10e09f63b17611fed9e9 Mon Sep 17 00:00:00 2001 From: Andrew Crites Date: Fri, 26 Oct 2018 16:25:00 -0400 Subject: [PATCH] docs: use static zip function as an Observable creator. (#26790) The existing example makes it seem like zip is a pipeable operator. It can be used this way, but I think that is for backwards compatibility. You can achieve the same functionality by using it as an Observable creator. I think this also makes the example clearer. PR Close #26790 --- .../examples/practical-observable-usage/src/backoff.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aio/content/examples/practical-observable-usage/src/backoff.ts b/aio/content/examples/practical-observable-usage/src/backoff.ts index 97b53845f1..e9e88e7cb2 100644 --- a/aio/content/examples/practical-observable-usage/src/backoff.ts +++ b/aio/content/examples/practical-observable-usage/src/backoff.ts @@ -5,10 +5,9 @@ import { retryWhen, map, mergeMap } from 'rxjs/operators'; function backoff(maxTries, ms) { return pipe( - retryWhen(attempts => range(1, maxTries) + retryWhen(attempts => zip(range(1, maxTries), attempts) .pipe( - zip(attempts, (i) => i), - map(i => i * i), + map(([i]) => i * i), mergeMap(i => timer(i * ms)) ) )