Skip to content

Commit

Permalink
Fixes for README
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrattli committed Sep 28, 2024
1 parent be08567 commit c9bf511
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ Even more interesting, with `to_async_iterable` you can flip around from
the stream of events.

```python
obv = AsyncIteratorObserver()
subscription = subscribe_async(source, obv)
async for x in obv:
import aioreactive as rx

xs = rx.from_iterable([1, 2, 3])
async for x in xs:
print(x)
```

Expand All @@ -153,7 +154,7 @@ import aioreactive as rx
xs = rx.from_iterable([1, 2, 3])
result = []

obv = rx.AsyncIteratorObserver()
obv = rx.AsyncIteratorObserver(xs)
async with await xs.subscribe_async(obv) as subscription:
async for x in obv:
result.append(x)
Expand Down

0 comments on commit c9bf511

Please sign in to comment.