File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,16 @@ export interface IConfigCatClient extends IProvidesHooks {
85
85
forceRefreshAsync ( ) : Promise < RefreshResult > ;
86
86
87
87
/**
88
- * Waits for the client initialization.
89
- * @returns A promise that fulfills with the client's initialization state.
88
+ * Waits for the client to reach the ready state, i.e. to complete initialization.
89
+ *
90
+ * @remarks Ready state is reached as soon as the initial sync with the external cache (if any) completes.
91
+ * If this does not provide up-to-date config data, and the client is online (i.e. HTTP requests are allowed),
92
+ * the first config fetch operation is also awaited in Auto Poll mode before ready state is reported.
93
+ *
94
+ * That is, reaching the ready state usually means that the client is ready to evaluate feature flags.
95
+ * However, please note that it is not guaranteed. You can determine this by checking the return value.
96
+ *
97
+ * @returns A promise that fulfills with the state of the local cache at the time initialization was completed.
90
98
*/
91
99
waitForReady ( ) : Promise < ClientCacheState > ;
92
100
Original file line number Diff line number Diff line change @@ -6,7 +6,16 @@ import type { IEvaluationDetails } from "./RolloutEvaluator";
6
6
7
7
/** Hooks (events) that can be emitted by `ConfigCatClient`. */
8
8
export type HookEvents = {
9
- /** Occurs when the client is ready to provide the actual value of feature flags or settings. */
9
+ /**
10
+ * Occurs when the client reaches the ready state, i.e. completes initialization.
11
+ *
12
+ * @remarks Ready state is reached as soon as the initial sync with the external cache (if any) completes.
13
+ * If this does not produce up-to-date config data, and the client is online (i.e. HTTP requests are allowed),
14
+ * the first config fetch operation is also awaited in Auto Poll mode before ready state is reported.
15
+ *
16
+ * That is, reaching the ready state usually means that the client is ready to evaluate feature flags.
17
+ * However, please note that it is not guaranteed. You can determine this by checking the `cacheState` parameter.
18
+ */
10
19
clientReady : [ cacheState : ClientCacheState ] ;
11
20
/** Occurs after the value of a feature flag of setting has been evaluated. */
12
21
flagEvaluated : [ evaluationDetails : IEvaluationDetails ] ;
You can’t perform that action at this time.
0 commit comments