Skip to content

Commit

Permalink
Merge branch 'tm/tweak-css' of github.com:thefrontside/effection into…
Browse files Browse the repository at this point in the history
… tm/tweak-css
  • Loading branch information
taras committed Dec 15, 2023
2 parents 32fc0ee + 6ef3dc0 commit 3ff26af
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 439 deletions.
13 changes: 1 addition & 12 deletions www/docs/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,10 @@ async function fetch(url) {
}
```

Consulting the "async rosetta stone" below, we can substitute the async
Consulting the [Async Rosetta Stone](), we can substitute the async
constructs for their Effection counterparts to arrive at a line for line
translation.

| Async | Effection |
|-----------------|-----------------------|
|`Promise` | `Operation` |
|`new Promise()` | `action()` |
|`await` | `yield*` |
|`async function` | `function*` |
|`AsyncIterable` | `Stream` |
|`AsyncIterator` | `Subscription` |
|`for await` | `for yield* each` |


```js
function* fetch(url) {
return yield* action(function*(resolve, reject) {
Expand Down
12 changes: 12 additions & 0 deletions www/docs/async-rosetta-stone.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@


| Async/Await | Effection |
| ---------------- | ----------------- |
| `Promise` | `Operation` |
| `new Promise()` | `action()` |
| `await` | `yield*` |
| `async function` | `function*` |
| `AsyncIterable` | `Stream` |
| `AsyncIterator` | `Subscription` |
| `for await` | `for yield* each` |

9 changes: 6 additions & 3 deletions www/docs/structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
"Getting Started": [
["introduction.mdx", "Introduction"],
["installation.mdx", "Installation"],
["typescript.mdx", "TypeScript"],
["thinking-in-effection.mdx", "Thinking in Effection"],
["async-rosetta-stone.mdx", "Async Rosetta Stone"]
],
"Learn Effection": [
["operations.mdx", "Operations"],
["actions.mdx", "Actions and Suspensions"],
["resources.mdx", "Resources"],
["spawn.mdx", "Spawn"],
["collections.mdx", "Streams and Subscriptions"],
["events.mdx", "Events"],
["errors.mdx", "Error Handling"],
["typescript.mdx", "TypeScript"]
["errors.mdx", "Error Handling"]
],
"Advanced": [
["scope.mdx", "Scope"],
["testing.mdx", "Testing"],
["processes.mdx", "Processes"]
]
}
Loading

0 comments on commit 3ff26af

Please sign in to comment.