github launchdarkly/js-client-sdk 2.8.0

latest releases: 3.2.0, 3.1.4, 3.1.3...
5 years ago

[2.8.0] - 2018-12-03

Added:

  • The use of a streaming connection to LaunchDarkly for receiving live updates can now be controlled with the new client.setStreaming() method, or the equivalent boolean streaming property in the client configuration. If you set this to false, the client will not open a streaming connection even if you subscribe to change events (you might want to do this if, for instance, you just want to be notified when the client gets new flag values due to having switched users). If you set it to true, the client will open a streaming connection regardless of whether you subscribe to change events or not (the flag values will simply be updated in the background). If you don't set it either way then the default behavior still applies, i.e. the client opens a streaming connection if and only if you subscribe to change events.

Fixed:

  • If the client opened a streaming connection because you called on('change', ...) one or more times, it will not close the connection until you call off() for all of your event listeners. Previously, it was closing the connection whenever off('change') was called, even if you still had a listener for 'change:specific-flag-key'.
  • The client's logic for signaling a change event was using a regular Javascript === comparison, so it could incorrectly decide that a flag had changed if its value was a JSON object or an array. This has been fixed to use deep equality checking for object and array values.

Don't miss a new js-client-sdk release

NewReleases is sending notifications on new releases.