@nosnibor89/svelte-client-sdk 0.1.28 → 0.1.291
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/LDFlag.svelte +0 -4
- package/dist/client/SvelteLDClient.js +8 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/provider/LDProvider.svelte +0 -1
- package/package.json +2 -2
package/dist/LDFlag.svelte
CHANGED
@@ -42,7 +42,6 @@ function toFlagsProxy(client, flags) {
|
|
42
42
|
* @returns {Object} The LaunchDarkly instance object.
|
43
43
|
*/
|
44
44
|
function createLD() {
|
45
|
-
console.log('instantiating client');
|
46
45
|
let coreLdClient;
|
47
46
|
const loading = writable(true);
|
48
47
|
const flagsWritable = writable({});
|
@@ -58,18 +57,12 @@ function createLD() {
|
|
58
57
|
coreLdClient.on('ready', () => {
|
59
58
|
loading.set(false);
|
60
59
|
const rawFlags = coreLdClient.allFlags();
|
61
|
-
|
62
|
-
// const allFlags = toFlagsProxy(coreLdClient!, rawFlags);
|
63
|
-
const allFlags = rawFlags;
|
64
|
-
console.log('[LD] flag ready', rawFlags, allFlags);
|
60
|
+
const allFlags = toFlagsProxy(coreLdClient, rawFlags);
|
65
61
|
flagsWritable.set(allFlags);
|
66
62
|
});
|
67
|
-
coreLdClient.on('change', (
|
68
|
-
console.log('changed ctx', context, changedFlags);
|
63
|
+
coreLdClient.on('change', () => {
|
69
64
|
const rawFlags = coreLdClient.allFlags();
|
70
|
-
|
71
|
-
const allFlags = rawFlags;
|
72
|
-
console.log('[LD] flag changed', rawFlags, allFlags);
|
65
|
+
const allFlags = toFlagsProxy(coreLdClient, rawFlags);
|
73
66
|
flagsWritable.set(allFlags);
|
74
67
|
});
|
75
68
|
return {
|
@@ -77,17 +70,12 @@ function createLD() {
|
|
77
70
|
};
|
78
71
|
}
|
79
72
|
/**
|
80
|
-
* Identifies the user context.
|
81
|
-
*
|
82
|
-
* @
|
73
|
+
* Identifies the user context and returns the set of feature flags for that context.
|
74
|
+
*
|
75
|
+
* @param context - The LaunchDarkly context containing user information.
|
76
|
+
* @returns A promise that resolves to an LDFlagSet, which is a set of feature flags for the given context.
|
77
|
+
* @throws Will throw an error if the client is not initialized.
|
83
78
|
*/
|
84
|
-
// async function identify(context: LDContext): Promise<LDFlagSet> {
|
85
|
-
// isClientInitialized(coreLdClient);
|
86
|
-
// const allFlags = await coreLdClient.identify(context);
|
87
|
-
// // const allFlags = toFlagsProxy(coreLdClient!, rawFlags);
|
88
|
-
// flagsWritable.set(allFlags);
|
89
|
-
// return allFlags;
|
90
|
-
// }
|
91
79
|
async function identify(context) {
|
92
80
|
isClientInitialized(coreLdClient);
|
93
81
|
return coreLdClient.identify(context);
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { LD
|
1
|
+
export { LD } from './client/SvelteLDClient.js';
|
2
2
|
export type { LDOptions } from './client/SvelteLDClient.js';
|
3
3
|
export { default as LDProvider } from './provider/LDProvider.svelte';
|
4
4
|
export { default as LDFlag } from './LDFlag.svelte';
|
package/dist/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
// Reexport your entry components here
|
2
|
-
export { LD
|
2
|
+
export { LD } from './client/SvelteLDClient.js';
|
3
3
|
// Export Components
|
4
4
|
export { default as LDProvider } from './provider/LDProvider.svelte';
|
5
5
|
export { default as LDFlag } from './LDFlag.svelte';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nosnibor89/svelte-client-sdk",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.291",
|
4
4
|
"description": "Svelte LaunchDarkly SDK",
|
5
5
|
"homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/sdk/svelte",
|
6
6
|
"repository": {
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"svelte": "^5.0.0"
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@launchdarkly/js-client-sdk": "^0.
|
49
|
+
"@launchdarkly/js-client-sdk": "^0.4.1",
|
50
50
|
"esm-env": "^1.0.0"
|
51
51
|
},
|
52
52
|
"devDependencies": {
|