@statsig/client-core 0.0.1-beta.16 → 0.0.1-beta.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/client-core",
3
- "version": "0.0.1-beta.16",
3
+ "version": "0.0.1-beta.18",
4
4
  "dependencies": {},
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -18,9 +18,9 @@ export declare abstract class DataAdapterCore {
18
18
  /**
19
19
  * (Internal Use Only) - Used by \@statsig/react-native-bindings to prime the cache from AsyncStorage
20
20
  *
21
- * @param {Record<string, DataAdapterResult>} cache The values to set for _inMemoryCache
21
+ * @param {Record<string, DataAdapterResult>} cache The values to merge into _inMemoryCache
22
22
  */
23
- __setInMemoryCache(cache: Record<string, DataAdapterResult>): void;
23
+ __primeInMemoryCache(cache: Record<string, DataAdapterResult>): void;
24
24
  protected abstract _fetchFromNetwork(current: string | null, user?: StatsigUser): Promise<string | null>;
25
25
  private _fetchLatest;
26
26
  protected _getSdkKey(): string;
@@ -81,10 +81,10 @@ class DataAdapterCore {
81
81
  /**
82
82
  * (Internal Use Only) - Used by \@statsig/react-native-bindings to prime the cache from AsyncStorage
83
83
  *
84
- * @param {Record<string, DataAdapterResult>} cache The values to set for _inMemoryCache
84
+ * @param {Record<string, DataAdapterResult>} cache The values to merge into _inMemoryCache
85
85
  */
86
- __setInMemoryCache(cache) {
87
- this._inMemoryCache = cache;
86
+ __primeInMemoryCache(cache) {
87
+ this._inMemoryCache = Object.assign(Object.assign({}, this._inMemoryCache), cache);
88
88
  }
89
89
  _fetchLatest(current, user) {
90
90
  return __awaiter(this, void 0, void 0, function* () {
@@ -29,9 +29,9 @@ type DataAdapterCommon = {
29
29
  /**
30
30
  * (Internal Use Only) - Used by \@statsig/react-native-bindings to prime the cache from AsyncStorage
31
31
  *
32
- * @param {Record<string, DataAdapterResult>} cache The values to set for _inMemoryCache
32
+ * @param {Record<string, DataAdapterResult>} cache The values to merge into _inMemoryCache
33
33
  */
34
- readonly __setInMemoryCache: (cache: Record<string, DataAdapterResult>) => void;
34
+ readonly __primeInMemoryCache: (cache: Record<string, DataAdapterResult>) => void;
35
35
  };
36
36
  export type EvaluationsDataAdapter = DataAdapterCommon & {
37
37
  /**
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatsigMetadataProvider = void 0;
4
- const SDK_VERSION = '0.0.1-beta.16';
4
+ const SDK_VERSION = '0.0.1-beta.18';
5
5
  let metadata = {
6
6
  sdkVersion: SDK_VERSION,
7
7
  sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients