Skip to content

Commit c194e1b

Browse files
committed
readme
1 parent 3ccbd8d commit c194e1b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ npm i @hazae41/future
2222
```typescript
2323
import { Future } from "@hazae41/future"
2424

25-
const future = new Future<void, unknown>()
25+
const future = new Future<void>()
2626

27-
const okTimeout = setTimeout(() => future.ok(), 1000)
28-
const errTimeout = setTimeout(() => future.err(), 2000)
27+
const t1 = setTimeout(() => future.resolve(), 1000)
28+
const t2 = setTimeout(() => future.reject(), 2000)
2929

3030
try {
3131
await future.promise
3232
} finally {
33-
clearTimeout(okTimeout)
34-
clearTimeout(errTimeout)
33+
clearTimeout(t1)
34+
clearTimeout(t2)
3535
}
3636
```

0 commit comments

Comments
 (0)