Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #169 from mido3ds/patch-1
Browse files Browse the repository at this point in the history
Update api.md
  • Loading branch information
timsuchanek authored Nov 3, 2017
2 parents e34b387 + 3ddfd93 commit b3a111f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ await chromeless.wait('div#loaded', 1000)

Not implemented yet

Wait until a function returns.
Wait until a function returns. You can also return some Promise that will be resolved at some point.

__Arguments__
- `fn` - Function to wait for
Expand All @@ -172,7 +172,12 @@ __Arguments__
__Example__

```js
await chromeless.wait(() => { return console.log('@TODO: put a better example here') })
await chromeless.wait(() => {
return new Promise((resolve, reject) => {
// do something async, setTimeout...
resolve();
});
})
```

---------------------------------------
Expand Down

0 comments on commit b3a111f

Please sign in to comment.