File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export const getTodoById = (id: string) =>
13
13
Effect .gen (function * () {
14
14
const todo = yield * TodoService .getTodoById (" some-id" );
15
15
if (todo .description .length < 2 ) {
16
- return yield * Effect . fail ( new ValidationError (" Too small description" ) );
16
+ return yield * new ValidationError (" Too small description" );
17
17
}
18
18
return todo ;
19
19
});
@@ -27,7 +27,7 @@ import { effect } from "simply-effect";
27
27
export const getTodoById = effect (function * (id : string ) {
28
28
const todo = yield * TodoService .getTodoById (" some-id" );
29
29
if (todo .description .length < 2 ) {
30
- return yield * Effect . fail ( new ValidationError (" Too small description" ) );
30
+ return yield * new ValidationError (" Too small description" );
31
31
}
32
32
return todo ;
33
33
});
@@ -36,7 +36,7 @@ export const getTodoById = effect(function* (id: string) {
36
36
If the generator function has no arguments, then ` effect ` will work exactly the same as ` Effect.gen ` .
37
37
38
38
``` tsx
39
- const value: Effect .Effect <number > = effect (function * () {
39
+ const value: Effect .Effect <void > = effect (function * () {
40
40
yield * Console .log (1 );
41
41
});
42
42
```
You can’t perform that action at this time.
0 commit comments