Skip to content

Commit 462b5df

Browse files
Update Typescript-Example in Usage-Docs (#255)
1 parent 908cbf5 commit 462b5df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/usage.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@ import { spawn, Thread, Worker } from "threads"
167167
import { Counter } from "./workers/counter"
168168

169169
const counter = await spawn<Counter>(new Worker("./workers/counter"))
170+
console.log(`Initial counter: ${await counter.getCount()}`)
171+
170172
await counter.increment()
173+
console.log(`Updated counter: ${await counter.getCount()}`)
174+
175+
await Thread.terminate(counter)
171176
```
172177

173178
```ts

0 commit comments

Comments
 (0)