Skip to content

Commit 57796af

Browse files
committed
Documentation and string enum.
1 parent df41f81 commit 57796af

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
export enum DataSourceErrorKind {
22
/// An unexpected error, such as an uncaught exception, further
33
/// described by the error message.
4-
Unknown,
4+
Unknown = 'UNKNOWN',
55

66
/// An I/O error such as a dropped connection.
7-
NetworkError,
7+
NetworkError = 'NETWORK_ERROR',
88

99
/// The LaunchDarkly service returned an HTTP response with an error
1010
/// status, available in the status code.
11-
ErrorResponse,
11+
ErrorResponse = 'ERROR_RESPONSE',
1212

1313
/// The SDK received malformed data from the LaunchDarkly service.
14-
InvalidData,
14+
InvalidData = 'INVALID_DATA',
1515
}

packages/shared/sdk-client/src/api/LDClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ export interface LDClient {
214214
* The callback parameters are the context and an Error object. Errors are also output by
215215
* the {@link logger} at the error level.
216216
*
217+
* - `"dataSourceStatus"`: Event indicating that there has been a change in the status of the
218+
* data source. This will include the state of the data source as well any error information.
219+
*
217220
* @param key
218221
* The name of the event for which to listen.
219222
* @param callback

packages/shared/sdk-client/src/datasource/DataSourceStatus.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import DataSourceStatusErrorInfo from './DataSourceStatusErrorInfo';
22

33
export enum DataSourceState {
4-
Initializing,
5-
Valid,
6-
Interrupted,
7-
SetOffline,
8-
Closed,
4+
Initializing = 'INITIALIZING',
5+
Valid = 'VALID',
6+
Interrupted = 'INTERRUPTED',
7+
SetOffline = 'SET_OFFLINE',
8+
Closed = 'CLOSED',
99
// TODO: SDK-702 - Implement network availability behaviors
1010
// NetworkUnavailable,
1111
}

0 commit comments

Comments
 (0)