From 8dd3bd7493c70620adc3d7544e2f9955ece3a075 Mon Sep 17 00:00:00 2001 From: Janek Lasocki-Biczysko Date: Sun, 24 Dec 2023 11:36:10 +0000 Subject: [PATCH 1/2] chore: update sleep.ts example The jsdoc `@example` snippet is probably leftover from v2 since it's using `yield` instead of `yield*` --- lib/sleep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sleep.ts b/lib/sleep.ts index 94080071d..0ccb96485 100644 --- a/lib/sleep.ts +++ b/lib/sleep.ts @@ -9,7 +9,7 @@ import { action, suspend } from "./instructions.ts"; * import { main, sleep } from 'effection'; * * await main(function*() { - * yield sleep(2000); + * yield* sleep(2000); * console.log("Hello lazy world!"); * }); * ``` From 327a29515809dd4de5d24340209536bd9242e13f Mon Sep 17 00:00:00 2001 From: Janek Lasocki-Biczysko Date: Sun, 24 Dec 2023 11:36:13 +0000 Subject: [PATCH 2/2] update docs --- www/docs/collections.mdx | 2 +- www/docs/scope.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/docs/collections.mdx b/www/docs/collections.mdx index c97403882..b8c28aab7 100644 --- a/www/docs/collections.mdx +++ b/www/docs/collections.mdx @@ -191,7 +191,7 @@ await main(function*() { yield* sleep(1000); - let { value: secondValue } = yield subscription.next(); + let { value: secondValue } = yield* subscription.next(); console.log(secondValue); // logs 'world' }); ``` diff --git a/www/docs/scope.mdx b/www/docs/scope.mdx index 1d1077449..e621f5e39 100644 --- a/www/docs/scope.mdx +++ b/www/docs/scope.mdx @@ -249,7 +249,7 @@ await main(function*() { signal.addEventListener('abort', () => console.log('done!')); - yield sleep(5000); + yield* sleep(5000); // prints 'done!' }); ```