@nosnibor89/svelte-client-sdk 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/SvelteLDClient.js +10 -12
- package/package.json +1 -1
@@ -58,17 +58,16 @@ function createLD() {
|
|
58
58
|
coreLdClient.on('ready', () => {
|
59
59
|
loading.set(false);
|
60
60
|
const rawFlags = coreLdClient.allFlags();
|
61
|
-
|
62
|
-
// const allFlags =
|
63
|
-
const allFlags = rawFlags;
|
61
|
+
const allFlags = toFlagsProxy(coreLdClient, rawFlags);
|
62
|
+
// const allFlags = rawFlags;
|
64
63
|
console.log('[LD] flag ready', rawFlags, allFlags);
|
65
64
|
flagsWritable.set(allFlags);
|
66
65
|
});
|
67
66
|
coreLdClient.on('change', (context, changedFlags) => {
|
68
67
|
console.log('changed ctx', context, changedFlags);
|
69
68
|
const rawFlags = coreLdClient.allFlags();
|
70
|
-
|
71
|
-
const allFlags = rawFlags;
|
69
|
+
const allFlags = toFlagsProxy(coreLdClient, rawFlags);
|
70
|
+
// const allFlags = rawFlags;
|
72
71
|
console.log('[LD] flag changed', rawFlags, allFlags);
|
73
72
|
flagsWritable.set(allFlags);
|
74
73
|
});
|
@@ -77,16 +76,15 @@ function createLD() {
|
|
77
76
|
};
|
78
77
|
}
|
79
78
|
/**
|
80
|
-
* Identifies the user context.
|
81
|
-
*
|
82
|
-
* @
|
79
|
+
* Identifies the user context and returns the set of feature flags for that context.
|
80
|
+
*
|
81
|
+
* @param context - The LaunchDarkly context containing user information.
|
82
|
+
* @returns A promise that resolves to an LDFlagSet, which is a set of feature flags for the given context.
|
83
|
+
* @throws Will throw an error if the client is not initialized.
|
83
84
|
*/
|
84
85
|
async function identify(context) {
|
85
86
|
isClientInitialized(coreLdClient);
|
86
|
-
|
87
|
-
// const allFlags = toFlagsProxy(coreLdClient!, rawFlags);
|
88
|
-
flagsWritable.set(allFlags);
|
89
|
-
return allFlags;
|
87
|
+
return coreLdClient.identify(context);
|
90
88
|
}
|
91
89
|
/**
|
92
90
|
* Watches a flag for changes.
|
package/package.json
CHANGED