github Azure/azure-sdk-for-js @azure/cosmos_3.12.0

latest releases: @azure/core-rest-pipeline_1.16.0, @azure/core-amqp_4.2.2, @azure/communication-sms_1.2.0-beta.1...
2 years ago

3.12.0 (2021-07-06)

Features Added

  • With the dropping of support for Node.js versions that are no longer in LTS, the dependency on @types/node has been updated to version 12. Read our support policy for more details.
  • Added background refresher for endpoints, and new ConnectionPolicy options. Refreshing defaults to true, and the default refresh rate is every 5 minutes.
const client = new CosmosClient({
  endpoint,
  key: masterKey,
  connectionPolicy: {
    ...defaultConnectionPolicy,
    endpointRefreshRateInMs: 700,
    enableBackgroundEndpointRefreshing: true
  }
})
  • Added client.dispose() for closing the endpoint refresher verbosely. Necessary when destroying the CosmosClient inside existing processes like an express web server, or when you want to destroy the client and create a new one in the same process.
const client = new CosmosClient()
client.dispose() // cancels background endpoint refreshing

Don't miss a new azure-sdk-for-js release

NewReleases is sending notifications on new releases.