Skip to content

Commit

Permalink
Merge branch 'v3' into reduce-www-startup-time
Browse files Browse the repository at this point in the history
  • Loading branch information
taras authored Nov 7, 2023
2 parents 1dcd0a6 + 7c872c0 commit 8476689
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions lib/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export interface Channel<T, TClose> extends Stream<T, TClose> {
* import { main, createChannel } from 'effection';
*
* await main(function*() {
* let { input, output } = createChannel();
* let channel = createChannel();
*
* yield* input.send('too early'); // the channel has no subscribers yet!
* yield* channel.send('too early'); // the channel has no subscribers yet!
*
* let subscription1 = yield* channel;
* let subscription2 = yield* channel;
* let subscription1 = yield* channel.subscribe();
* let subscription2 = yield* channel.subscribe();
*
* yield* input.send('hello');
* yield* input.send('world');
* yield* channel.send('hello');
* yield* channel.send('world');
*
* console.log(yield* subscription1.next()); //=> { done: false, value: 'hello' }
* console.log(yield* subscription1.next()); //=> { done: false, value: 'world' }
Expand Down
8 changes: 4 additions & 4 deletions www/docs/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ to show the difference between them:
import { main, createChannel } from 'effection';

await main(function*() {
let { send, subscribe} = createChannel();
let channel = createChannel();

// the channel has no subscribers yet!
yield* send('too early');
yield* channel.send('too early');

let subscription1 = yield* subscribe();
let subscription2 = yield* subscribe();
let subscription1 = yield* channel.subscribe();
let subscription2 = yield* channel.subscribe();

yield* send('hello');
yield* send('world');
Expand Down

0 comments on commit 8476689

Please sign in to comment.