From f07d23c25f23693bc7f76fd6478b04dba3ec3241 Mon Sep 17 00:00:00 2001 From: Min Kim Date: Tue, 9 Jan 2024 08:40:37 -0500 Subject: [PATCH 1/4] Fix minor typos/formatting in docs --- www/deno.lock | 52 +++++++++++++++++++-------------------- www/docs/collections.mdx | 8 +++--- www/docs/installation.mdx | 4 +-- www/docs/resources.mdx | 6 ++--- www/docs/tutorial.mdx | 2 +- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/www/deno.lock b/www/deno.lock index d740516ab..a7a8d0c25 100644 --- a/www/deno.lock +++ b/www/deno.lock @@ -103,8 +103,8 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dependencies": {} }, - "@types/hast@2.3.8": { - "integrity": "sha512-aMIqAlFd2wTIDZuvLbhUT+TGvMxrNC8ECUIVtH6xxy0sQLs3iu6NO8Kp/VT5je7i5ufnebXzdV1dNDMnvaH6IQ==", + "@types/hast@2.3.9": { + "integrity": "sha512-pTHyNlaMD/oKJmS+ZZUyFUcsZeBZpC0lmGquw98CqRVNgAdJZJeD7GoeLiT6Xbx5rU9VCjSt0RwEvDgzh4obFw==", "dependencies": { "@types/unist": "@types/unist@2.0.10" } @@ -151,14 +151,14 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dependencies": {} }, - "acorn-jsx@5.3.2_acorn@8.11.2": { + "acorn-jsx@5.3.2_acorn@8.11.3": { "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dependencies": { - "acorn": "acorn@8.11.2" + "acorn": "acorn@8.11.3" } }, - "acorn@8.11.2": { - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "acorn@8.11.3": { + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dependencies": {} }, "astring@1.8.6": { @@ -309,7 +309,7 @@ "hast-util-from-parse5@7.1.2": { "integrity": "sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/unist": "@types/unist@2.0.10", "hastscript": "hastscript@7.2.0", "property-information": "property-information@6.4.0", @@ -348,7 +348,7 @@ "hast-util-heading-rank@2.1.1": { "integrity": "sha512-iAuRp+ESgJoRFJbSyaqsfvJDY6zzmFoEnL1gtz1+U8gKtGGj1p0CVlysuUAUjq95qlZESHINLThwJzNGmgGZxA==", "dependencies": { - "@types/hast": "@types/hast@2.3.8" + "@types/hast": "@types/hast@2.3.9" } }, "hast-util-is-element@1.1.0": { @@ -358,14 +358,14 @@ "hast-util-is-element@2.1.3": { "integrity": "sha512-O1bKah6mhgEq2WtVMk+Ta5K7pPMqsBBlmzysLdcwKVrqzZQ0CHqUPiIVspNhAG1rvxpvJjtGee17XfauZYKqVA==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/unist": "@types/unist@2.0.10" } }, "hast-util-parse-selector@3.1.1": { "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==", "dependencies": { - "@types/hast": "@types/hast@2.3.8" + "@types/hast": "@types/hast@2.3.9" } }, "hast-util-parse-selector@4.0.0": { @@ -434,7 +434,7 @@ "dependencies": { "@types/estree": "@types/estree@1.0.5", "@types/estree-jsx": "@types/estree-jsx@1.0.3", - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/unist": "@types/unist@2.0.10", "comma-separated-tokens": "comma-separated-tokens@2.0.3", "estree-util-attach-comments": "estree-util-attach-comments@2.1.1", @@ -481,7 +481,7 @@ "hast-util-to-string@2.0.0": { "integrity": "sha512-02AQ3vLhuH3FisaMM+i/9sm4OXGSq1UhOOCpTLLQtHdL3tZt7qil69r8M8iDkZYyC0HCFylcYoP+8IO7ddta1A==", "dependencies": { - "@types/hast": "@types/hast@2.3.8" + "@types/hast": "@types/hast@2.3.9" } }, "hast-util-to-string@3.0.0": { @@ -507,7 +507,7 @@ "hastscript@7.2.0": { "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "comma-separated-tokens": "comma-separated-tokens@2.0.3", "hast-util-parse-selector": "hast-util-parse-selector@3.1.1", "property-information": "property-information@6.4.0", @@ -671,7 +671,7 @@ "integrity": "sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==", "dependencies": { "@types/estree-jsx": "@types/estree-jsx@1.0.3", - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/mdast": "@types/mdast@3.0.15", "mdast-util-from-markdown": "mdast-util-from-markdown@1.3.1", "mdast-util-to-markdown": "mdast-util-to-markdown@1.5.0" @@ -681,7 +681,7 @@ "integrity": "sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==", "dependencies": { "@types/estree-jsx": "@types/estree-jsx@1.0.3", - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/mdast": "@types/mdast@3.0.15", "@types/unist": "@types/unist@2.0.10", "ccount": "ccount@2.0.1", @@ -708,7 +708,7 @@ "integrity": "sha512-SXqglS0HrEvSdUEfoXFtcg7DRl7S2cwOXc7jkuusG472Mmjag34DUDeOJUZtl+BVnyeO1frIgVpHlNRWc2gk/w==", "dependencies": { "@types/estree-jsx": "@types/estree-jsx@1.0.3", - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/mdast": "@types/mdast@3.0.15", "mdast-util-from-markdown": "mdast-util-from-markdown@1.3.1", "mdast-util-to-markdown": "mdast-util-to-markdown@1.5.0" @@ -724,7 +724,7 @@ "mdast-util-to-hast@12.3.0": { "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/mdast": "@types/mdast@3.0.15", "mdast-util-definitions": "mdast-util-definitions@5.1.2", "micromark-util-sanitize-uri": "micromark-util-sanitize-uri@1.2.0", @@ -907,11 +907,11 @@ "vfile-message": "vfile-message@3.1.4" } }, - "micromark-extension-mdxjs@1.0.1_acorn@8.11.2": { + "micromark-extension-mdxjs@1.0.1_acorn@8.11.3": { "integrity": "sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==", "dependencies": { - "acorn": "acorn@8.11.2", - "acorn-jsx": "acorn-jsx@5.3.2_acorn@8.11.2", + "acorn": "acorn@8.11.3", + "acorn-jsx": "acorn-jsx@5.3.2_acorn@8.11.3", "micromark-extension-mdx-expression": "micromark-extension-mdx-expression@1.0.8", "micromark-extension-mdx-jsx": "micromark-extension-mdx-jsx@1.0.5", "micromark-extension-mdx-md": "micromark-extension-mdx-md@1.0.1", @@ -1195,7 +1195,7 @@ "refractor@4.8.1": { "integrity": "sha512-/fk5sI0iTgFYlmVGYVew90AoYnNMP6pooClx/XKqyeeCQXrL0Kvgn8V0VEht5ccdljbzzF1i3Q213gcntkRExg==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/prismjs": "@types/prismjs@1.26.3", "hastscript": "hastscript@7.2.0", "parse-entities": "parse-entities@4.0.1" @@ -1210,7 +1210,7 @@ "rehype-autolink-headings@6.1.1": { "integrity": "sha512-NMYzZIsHM3sA14nC5rAFuUPIOfg+DFmf9EY1YMhaNlB7+3kK/ZlE6kqPfuxr1tsJ1XWkTrMtMoyHosU70d35mA==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "extend": "extend@3.0.2", "hast-util-has-property": "hast-util-has-property@2.0.1", "hast-util-heading-rank": "hast-util-heading-rank@2.1.1", @@ -1222,7 +1222,7 @@ "rehype-parse@8.0.5": { "integrity": "sha512-Ds3RglaY/+clEX2U2mHflt7NlMA72KspZ0JLUJgBBLpRddBcEw3H8uYZQliQriku22NZpYMfjDdSgHcjxue24A==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "hast-util-from-parse5": "hast-util-from-parse5@7.1.2", "parse5": "parse5@6.0.1", "unified": "unified@10.1.2" @@ -1242,7 +1242,7 @@ "rehype-slug@5.1.0": { "integrity": "sha512-Gf91dJoXneiorNEnn+Phx97CO7oRMrpi+6r155tTxzGuLtm+QrI4cTwCa9e1rtePdL4i9tSO58PeSS6HWfgsiw==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "github-slugger": "github-slugger@2.0.0", "hast-util-has-property": "hast-util-has-property@2.0.1", "hast-util-heading-rank": "hast-util-heading-rank@2.1.1", @@ -1264,7 +1264,7 @@ "integrity": "sha512-g53hMkpM0I98MU266IzDFMrTD980gNF3BJnkyFcmN+dD873mQeD5rdMO3Y2X+x8umQfbSE0PcoEDl7ledSA+2g==", "dependencies": { "mdast-util-mdx": "mdast-util-mdx@2.0.1", - "micromark-extension-mdxjs": "micromark-extension-mdxjs@1.0.1_acorn@8.11.2" + "micromark-extension-mdxjs": "micromark-extension-mdxjs@1.0.1_acorn@8.11.3" } }, "remark-parse@10.0.2": { @@ -1278,7 +1278,7 @@ "remark-rehype@10.1.0": { "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==", "dependencies": { - "@types/hast": "@types/hast@2.3.8", + "@types/hast": "@types/hast@2.3.9", "@types/mdast": "@types/mdast@3.0.15", "mdast-util-to-hast": "mdast-util-to-hast@12.3.0", "unified": "unified@10.1.2" diff --git a/www/docs/collections.mdx b/www/docs/collections.mdx index b8c28aab7..ebb98f290 100644 --- a/www/docs/collections.mdx +++ b/www/docs/collections.mdx @@ -80,8 +80,8 @@ await main(function*() { let subscription1 = yield* channel; let subscription2 = yield* channel; - yield* send('hello'); - yield* send('world'); + yield* channel.send('hello'); + yield* channel.send('world'); console.log(yield* subscription1.next()); //=> { done: false, value: "hello" } @@ -173,7 +173,7 @@ will not drop a message even though it may receive deliveries even while the consumer is doing other things: ``` javascript -imchannel { main, createChannel, spawn, sleep } from 'effection'; +import { main, createChannel, spawn, sleep } from 'effection'; await main(function*() { let channel = createChannel(); @@ -207,7 +207,7 @@ end state. For example, when a websocket is closed it emits a why the socked was closed. The value of this last piece of data is the value of the iterator result when -the `done` attribute is true. Unsprisingly, this mirrors the behavior of an +the `done` attribute is true. Unsurprisingly, this mirrors the behavior of an async iterator exactly. ```js diff --git a/www/docs/installation.mdx b/www/docs/installation.mdx index 32af74b4a..18fbd9c4d 100644 --- a/www/docs/installation.mdx +++ b/www/docs/installation.mdx @@ -12,10 +12,10 @@ If you encounter obstacles integrating with your environment, please create a [G Effection is available on [NPM][npm], as well as derived registries such as [Yarn][yarn] and [UNPKG][unpkg]. It comes with TypeScript types and can be consumed as both ESM and CommonJS. ```bash -// install with npm +# install with npm npm install effection -// install with yarn +# install with yarn yarn add effection ``` diff --git a/www/docs/resources.mdx b/www/docs/resources.mdx index a25fc2d19..c690f7b41 100644 --- a/www/docs/resources.mdx +++ b/www/docs/resources.mdx @@ -34,7 +34,7 @@ automatically. Our first attempt to do so might look something like this: import { once, suspend } from 'effection'; import { Socket } from 'net'; -export function *useSocket(port, host) { +export function* useSocket(port, host) { let socket = new Socket(); socket.connect(port, host); @@ -125,7 +125,7 @@ Resources can depend on other resources, so we could use this to make a socket which sends a heart-beat every 10 seconds. ``` javascript -import { main, resource } from 'effection'; +import { main, resource, spawn } from 'effection'; import { useSocket } from './use-socket'; function useHeartSocket(port, host) { @@ -147,7 +147,7 @@ await main(function*() { let socket = yield* useHeartSocket(1337, '127.0.0.1'); // waits for the socket to connect socket.write({ hello: 'world' }); // this works // once `main` finishes: - // 1. the heartbea is stopped + // 1. the heartbeat is stopped // 2. the socket is closed }); ``` diff --git a/www/docs/tutorial.mdx b/www/docs/tutorial.mdx index bad5034fc..26edccbf6 100644 --- a/www/docs/tutorial.mdx +++ b/www/docs/tutorial.mdx @@ -3,7 +3,7 @@ Let's write our first program using Effection. ``` javascript import { call, useAbortSignal } from "effection"; -export function *fetchWeekDay(timezone) { +export function* fetchWeekDay(timezone) { let signal = yield* useAbortSignal(); let response = yield* call(fetch(`http://worldclockapi.com/api/json/${timezone}/now`, { signal })); From d47cb13163e899da8f030d081a7dbd3966075143 Mon Sep 17 00:00:00 2001 From: Min Kim Date: Tue, 9 Jan 2024 09:06:46 -0500 Subject: [PATCH 2/4] Capitalize H in GitHub for the header link --- www/components/header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/components/header.tsx b/www/components/header.tsx index 42b62a408..87fb52064 100644 --- a/www/components/header.tsx +++ b/www/components/header.tsx @@ -33,7 +33,7 @@ export function Header() { From 8f1428b84714181eea7091f290a28c99b4bece4e Mon Sep 17 00:00:00 2001 From: Min Kim Date: Wed, 10 Jan 2024 13:33:24 -0500 Subject: [PATCH 3/4] Capitalize first letter of subsection 'immediate return' --- www/docs/scope.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/docs/scope.mdx b/www/docs/scope.mdx index e621f5e39..f3a000aa4 100644 --- a/www/docs/scope.mdx +++ b/www/docs/scope.mdx @@ -95,7 +95,7 @@ await task.halt(); Halting a Task means that its operation is canceled, and it also causes any operation created by that operation to be halted. -### immediate return +### Immediate return If an Operation is expressed as a generator (most are), we call `return()` on the generator when that operation is halted. This From 2edc5aea05cb889006499c808e1f1ae3e5f8f4ee Mon Sep 17 00:00:00 2001 From: Min Kim Date: Wed, 10 Jan 2024 13:36:03 -0500 Subject: [PATCH 4/4] Remove period from subsection --- www/docs/spawn.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/docs/spawn.mdx b/www/docs/spawn.mdx index ec0350ff4..59d6539ea 100644 --- a/www/docs/spawn.mdx +++ b/www/docs/spawn.mdx @@ -162,7 +162,7 @@ main(function *() { }); ``` -### Spawning in a Scope. +### Spawning in a Scope The `spawn()` operation always runs its operation as a child of the current operation. Sometimes however, you might want to run an operation as a child of a