@nosnibor89/svelte-client-sdk 0.1.28 → 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.
@@ -58,17 +58,16 @@ function createLD() {
58
58
  coreLdClient.on('ready', () => {
59
59
  loading.set(false);
60
60
  const rawFlags = coreLdClient.allFlags();
61
- // coreLdClient;
62
- // const allFlags = toFlagsProxy(coreLdClient!, rawFlags);
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
- // const allFlags = toFlagsProxy(coreLdClient!, rawFlags);
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,17 +76,12 @@ function createLD() {
77
76
  };
78
77
  }
79
78
  /**
80
- * Identifies the user context.
81
- * @param {LDContext} context - The user context.
82
- * @returns {Promise} A promise that resolves when the user is identified.
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
- // 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
85
  async function identify(context) {
92
86
  isClientInitialized(coreLdClient);
93
87
  return coreLdClient.identify(context);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosnibor89/svelte-client-sdk",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Svelte LaunchDarkly SDK",
5
5
  "homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/sdk/svelte",
6
6
  "repository": {