Skip to content

Commit ee405e2

Browse files
committed
fix type annotation
1 parent fd03044 commit ee405e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const getTodoById = (id: string) =>
1313
Effect.gen(function* () {
1414
const todo = yield* TodoService.getTodoById("some-id");
1515
if (todo.description.length < 2) {
16-
return yield* Effect.fail(new ValidationError("Too small description"));
16+
return yield* new ValidationError("Too small description");
1717
}
1818
return todo;
1919
});
@@ -27,7 +27,7 @@ import { effect } from "simply-effect";
2727
export const getTodoById = effect(function* (id: string) {
2828
const todo = yield* TodoService.getTodoById("some-id");
2929
if (todo.description.length < 2) {
30-
return yield* Effect.fail(new ValidationError("Too small description"));
30+
return yield* new ValidationError("Too small description");
3131
}
3232
return todo;
3333
});
@@ -36,7 +36,7 @@ export const getTodoById = effect(function* (id: string) {
3636
If the generator function has no arguments, then `effect` will work exactly the same as `Effect.gen`.
3737

3838
```tsx
39-
const value: Effect.Effect<number> = effect(function* () {
39+
const value: Effect.Effect<void> = effect(function* () {
4040
yield* Console.log(1);
4141
});
4242
```

0 commit comments

Comments
 (0)