Skip to content

Commit

Permalink
Fixing syntax error in todos.md (#57)
Browse files Browse the repository at this point in the history
* Fixing syntax error & TypeScript warning in todos.md

This fixes two small code issues that I came across was I was following the tutorial:

First, a syntax error in `todoActions$`.

Secondly, a TypeScript warning in the definition of `useTodos`:
```
Type 'IterableIterator<Todo>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
```

Replacing `[...todosMap.values()]` with `Array.from(todosMap.values())` makes that warning go away without customising TypeScript from its default value.

* Revert TypeScript warning
  • Loading branch information
sebmos authored Jul 29, 2023
1 parent 74084aa commit 149f51d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/tutorial/todos.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ Which is basically the same as doing this (but a lot shorter, of course :smile:)

```tsx
const todoActions$ = merge(
newTodo$.pipe(map(text, id) => ({
type: "add" as const
newTodo$.pipe(map((text, id) => ({
type: "add" as const,
payload: { id, text },
})),
}))),
editTodo$.pipe(map(payload => ({
type: "edit" as const,
payload,
Expand Down

0 comments on commit 149f51d

Please sign in to comment.