Skip to content

Commit 70d2cc3

Browse files
docs(README): fix some references to the old callback API
1 parent 21fc514 commit 70d2cc3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ All requests support the following two Syntax options where both `err` and `data
5858
_Note that all response objects will supply both the original [obs-websocket][link-obswebsocket] response items in their original format (ex: `'response-item'`), but also camelCased (ex: `'responseItem'`) for convenience._
5959
- RequestName must exactly match what is defined by the [`obs-websocket`][link-obswebsocket] plugin.
6060
- `{args}` are optional. Note that both `request-type` and `message-id` will be bound automatically.
61-
- `callback(err, data)` is optional.
61+
- To use callbacks instead of promises, use the `sendCallback` method insetad of `send`.
6262

6363
```js
64-
obs.send('RequestName', {args}, callback(err, data)) returns Promise
64+
// Promise API
65+
obs.send('RequestName', {args}) returns Promise
66+
67+
// Callback API
68+
obs.sendCallback('RequestName', {args}, callback(err, data)) no return value
6569

6670
// The following are additional supported requests.
67-
obs.connect({ address: 'address', password: 'password' }, callback(err, data)) returns Promise
71+
obs.connect({ address: 'address', password: 'password' }) returns Promise
6872
obs.disconnect();
6973
```
7074

0 commit comments

Comments
 (0)