Skip to content

Commit 03e1d69

Browse files
docs(readme): update examples
1 parent 85c218a commit 03e1d69

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

README.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Node.js client library to use the Watson APIs.
1818
* [Client-side usage](#client-side-usage)
1919
* [Authentication](#authentication)
2020
* [Setting the Service URL](#setting-the-service-url)
21-
* [Callbacks vs Promises](#callbacks-vs-promises)
21+
* [Promises](#promises)
2222
* [Sending request headers](#sending-request-headers)
2323
* [Parsing HTTP response](#parsing-http-response)
2424
* [Data collection opt-out](#data-collection-opt-out)
@@ -222,10 +222,9 @@ const discovery = DiscoveryV1({
222222
discovery.setServiceUrl('<new url>');
223223
```
224224

225-
## Callbacks vs Promises
226-
227-
All SDK methods are asynchronous, as they are making network requests to Watson services. To handle receiving the data from these requests, the SDK offers support for both Promises and Callback functions. Note that support for Callbacks is being deprecated and will be removed in a future major release. Using Promises is recommended.
225+
## Promises
228226

227+
All SDK methods are asynchronous, as they are making network requests to Watson services. To handle receiving the data from these requests, the SDK offers support with Promises.
229228
```js
230229
const DiscoveryV1 = require('ibm-watson/discovery/v1');
231230

@@ -246,15 +245,6 @@ discovery.listEnvironments()
246245
async function callDiscovery() { // note that callDiscovery also returns a Promise
247246
const body = await discovery.listEnvironments();
248247
}
249-
250-
// using a Callback function
251-
discovery.listEnvironments((err, res) => {
252-
if (err) {
253-
console.log(err);
254-
} else {
255-
console.log(JSON.stringify(res, null, 2));
256-
}
257-
});
258248
```
259249

260250
## Sending request headers
@@ -525,6 +515,7 @@ assistant.message(
525515
```
526516

527517
### Compare Comply
518+
**IBM Watson™ Compare and Comply is discontinued. Existing instances are supported until 30 November 2021, but as of 1 December 2020, you can't create instances. Any instance that exists on 30 November 2021 will be deleted. Consider migrating to Watson Discovery Premium on IBM Cloud for your Compare and Comply use cases. To start the migration process, visit https://ibm.biz/contact-wdc-premium.**
528519

529520
Use the Compare Comply service to compare and classify documents.
530521

@@ -856,6 +847,7 @@ toneAnalyzer.tone(
856847
```
857848

858849
### Visual Recognition v4
850+
**IBM Watson™ Visual Recognition is discontinued. Existing instances are supported until 1 December 2021, but as of 7 January 2021, you can't create instances. Any instance that is provisioned on 1 December 2021 will be deleted.**
859851

860852
Use the [Visual Recognition][visual_recognition] service to recognize the
861853
following picture.

0 commit comments

Comments
 (0)