Skip to content

Commit bd8c52f

Browse files
Update type definition comments
1 parent b9c6bf9 commit bd8c52f

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1.14.0 (September 12, 2024)
1+
1.14.0 (September 13, 2024)
22
- Added `status` property to Split reducer's slice of state to track the SDK events of non-default clients (Related to https://github.com/splitio/redux-client/issues/113).
33
- Added `lastUpdate` and `isTimedout` properties to the object returned by the `getStatus` helper and `selectTreatmentAndStatus` and `selectTreatmentWithConfigAndStatus` selectors, to expose the last event timestamp and the timedout status of the SDK clients (Related to https://github.com/splitio/redux-client/issues/113).
44
- Added `selectStatus` selector to retrieve the status properties of the SDK manager and clients from the Split state.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-redux",
3-
"version": "1.14.0",
3+
"version": "1.13.1-rc.2",
44
"description": "A library to easily use Split JS SDK with Redux and React Redux",
55
"main": "lib/index.js",
66
"module": "es/index.js",

src/helpers.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,10 @@ export function getSplits(): SplitIO.SplitViews {
8787
}
8888

8989
/**
90-
* Gets an object with the status properties of the SDK client or manager:
90+
* Gets an object with the status properties of the SDK client or manager.
9191
*
92-
* - `isReady` indicates if the SDK client has emitted the SDK_READY event.
93-
* - `isReadyFromCache` indicates if the SDK client has emitted the SDK_READY_FROM_CACHE event.
94-
* - `hasTimedout` indicates if the SDK client has emitted the SDK_READY_TIMED_OUT event.
95-
* - `isDestroyed` indicates if the SDK client has been destroyed, i.e., if the `destroySplitSdk` action was dispatched.
92+
* This function is similar to the `selectStatus` selector, but it does not require the Split state as a parameter since it uses the global `splitSdk` object.
93+
* Consider using the `selectStatus` selector instead for a more Redux-friendly approach.
9694
*
9795
* @param {SplitIO.SplitKey} key To use only on client-side. Ignored in server-side. If a key is provided and a client associated to that key has been used, the status of that client is returned.
9896
* If no key is provided, the status of the main client and manager is returned (the main client shares the status with the manager).

src/selectors.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,15 @@ export function selectTreatmentWithConfigAndStatus(splitState: ISplitState, feat
8585
}
8686

8787
/**
88-
* This function extracts the status properties of the client for the given user key from the Split state.
89-
* If no user key is provided, it returns the status properties of the main client, which matches the SDK manager status.
88+
* Extracts an object with the status properties of the SDK manager or client from the Split state, for the given user key.
9089
*
9190
* @param {ISplitState} splitState
92-
* @param {SplitIO.SplitKey} key
91+
* @param {SplitIO.SplitKey} key To use only on client-side. Ignored in server-side. If a key is provided and a client associated to that key has been used, the status of that client is returned.
92+
* If no key is provided, the status of the main client and manager is returned (the main client shares the status with the manager).
93+
*
94+
* @returns {IStatus} The status of the SDK client or manager.
95+
*
96+
* @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#subscribe-to-events}
9397
*/
9498
export function selectStatus(splitState: ISplitState, key?: SplitIO.SplitKey): IStatus {
9599
const status = splitState ?

0 commit comments

Comments
 (0)