Skip to content

Commit

Permalink
Merge pull request #882 from minkimcello/mk/minor-doc-fixes
Browse files Browse the repository at this point in the history
Minor doc fixes
  • Loading branch information
cowboyd authored Jan 12, 2024
2 parents 9d7c006 + 2edc5ae commit e990bc0
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion www/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function Header() {
<IconGithHub />
</span>
<span class="hidden md:inline-flex">
Github
GitHub
</span>
</a>
</li>
Expand Down
52 changes: 26 additions & 26 deletions www/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions www/docs/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions www/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
6 changes: 3 additions & 3 deletions www/docs/resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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) {
Expand All @@ -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
});
```
Expand Down
2 changes: 1 addition & 1 deletion www/docs/scope.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion www/docs/spawn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion www/docs/tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
Expand Down

0 comments on commit e990bc0

Please sign in to comment.