File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @eppo/js-client-sdk" ,
3
- "version" : " 3.9.4-alpha.4 " ,
3
+ "version" : " 3.9.4-alpha.5 " ,
4
4
"description" : " Eppo SDK for client-side JavaScript applications" ,
5
5
"main" : " dist/index.js" ,
6
6
"files" : [
Original file line number Diff line number Diff line change 6
6
MemoryStore ,
7
7
PrecomputedFlag ,
8
8
} from '@eppo/js-client-sdk-common' ;
9
+ import { IObfuscatedPrecomputedBandit } from '@eppo/js-client-sdk-common/dist/interfaces' ;
9
10
10
11
import ChromeStorageAsyncMap from './cache/chrome-storage-async-map' ;
11
12
import { ChromeStorageEngine } from './chrome-storage-engine' ;
@@ -20,6 +21,10 @@ export function precomputedFlagsStorageFactory(): IConfigurationStore<Precompute
20
21
return new MemoryOnlyConfigurationStore ( ) ;
21
22
}
22
23
24
+ export function precomputedBanditStoreFactory ( ) : IConfigurationStore < IObfuscatedPrecomputedBandit > {
25
+ return new MemoryOnlyConfigurationStore ( ) ;
26
+ }
27
+
23
28
export function configurationStorageFactory (
24
29
{
25
30
maxAgeSeconds = 0 ,
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import {
33
33
hasChromeStorage ,
34
34
hasWindowLocalStorage ,
35
35
localStorageIfAvailable ,
36
+ precomputedBanditStoreFactory ,
36
37
} from './configuration-factory' ;
37
38
import BrowserNetworkStatusListener from './events/browser-network-status-listener' ;
38
39
import LocalStorageBackedNamedEventQueue from './events/local-storage-backed-named-event-queue' ;
@@ -721,6 +722,14 @@ export function offlinePrecomputedInit(
721
722
) ;
722
723
memoryOnlyPrecomputedStore . salt = parsedResponse . salt ;
723
724
725
+ const memoryOnlyPrecomputedBanditStore = precomputedBanditStoreFactory ( ) ;
726
+ memoryOnlyPrecomputedBanditStore
727
+ . setEntries ( parsedResponse . bandits )
728
+ . catch ( ( err ) =>
729
+ applicationLogger . warn ( 'Error setting precomputed bandits for memory-only store' , err ) ,
730
+ ) ;
731
+ memoryOnlyPrecomputedBanditStore . salt = parsedResponse . salt ;
732
+
724
733
const subject : Subject = {
725
734
subjectKey,
726
735
subjectAttributes : subjectAttributes ?? { } ,
@@ -729,6 +738,7 @@ export function offlinePrecomputedInit(
729
738
shutdownEppoPrecomputedClient ( ) ;
730
739
EppoPrecomputedJSClient . instance = new EppoPrecomputedJSClient ( {
731
740
precomputedFlagStore : memoryOnlyPrecomputedStore ,
741
+ precomputedBanditStore : memoryOnlyPrecomputedBanditStore ,
732
742
subject,
733
743
} ) ;
734
744
You can’t perform that action at this time.
0 commit comments