Skip to content

Commit

Permalink
Updated read me docs to include typescript support
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Oct 1, 2017
1 parent 7938217 commit e5d141b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ async function asyncTask(cb) {
}
```

## Type script usage
```javascript
interface ServerResponse {
test: number;
}

const p = Promise.resolve({test: 123});

const [err, data] = await to<ServerResponse>(p);
console.log(data.test);
```

## License

MIT © [Dima Grossman](http://blog.grossman.io) && Tomer Barnea
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "await-to-js",
"version": "2.0.0",
"version": "2.0.1",
"description": "Async/await wrapper for easy error handling in js",
"keywords": [
"node",
Expand Down

0 comments on commit e5d141b

Please sign in to comment.