@@ -295,19 +295,7 @@ export type InitOptions = ReflagDeprecatedContext & {
295295 * Defaults to `StorageOverridesProvider` using local storage.
296296 */
297297 overridesProvider ?: OverridesProvider ;
298- } ;
299298
300- /**
301- * Init options for bootstrapped flags.
302- */
303- export type InitOptionsBootstrapped = Omit <
304- InitOptions ,
305- | "fallbackFlags"
306- | "timeoutMs"
307- | "staleWhileRevalidate"
308- | "staleTimeMs"
309- | "expireTimeMs"
310- > & {
311299 /**
312300 * Pre-fetched flags to be used instead of fetching them from the server.
313301 */
@@ -316,13 +304,9 @@ export type InitOptionsBootstrapped = Omit<
316304 /**
317305 * Pre-fetched flag overrides to be used instead of reading them from the client.
318306 */
319- bootstrappedOverrides : FlagOverrides ;
307+ bootstrappedOverrides ? : FlagOverrides ;
320308} ;
321309
322- function isBootstrapped ( opts : InitOptions ) : opts is InitOptionsBootstrapped {
323- return "bootstrappedFlags" in opts ;
324- }
325-
326310const defaultConfig : Config = {
327311 apiBaseUrl : API_BASE_URL ,
328312 appBaseUrl : APP_BASE_URL ,
@@ -418,7 +402,7 @@ export class ReflagClient {
418402 /**
419403 * Create a new ReflagClient instance.
420404 */
421- constructor ( opts : InitOptions | InitOptionsBootstrapped ) {
405+ constructor ( opts : InitOptions ) {
422406 this . publishableKey = opts . publishableKey ;
423407 this . logger =
424408 opts ?. logger ?? loggerWithPrefix ( quietConsoleLogger , "[Reflag]" ) ;
@@ -453,22 +437,17 @@ export class ReflagClient {
453437 this . httpClient ,
454438 this . context ,
455439 this . logger ,
456- isBootstrapped ( opts )
457- ? {
458- bootstrappedFlags : opts . bootstrappedFlags ,
459- bootstrappedOverrides : opts . bootstrappedOverrides ,
460- offline : this . config . offline ,
461- overridesProvider : opts . overridesProvider ,
462- }
463- : {
464- expireTimeMs : opts . expireTimeMs ,
465- staleTimeMs : opts . staleTimeMs ,
466- staleWhileRevalidate : opts . staleWhileRevalidate ,
467- timeoutMs : opts . timeoutMs ,
468- fallbackFlags : opts . fallbackFlags ,
469- offline : this . config . offline ,
470- overridesProvider : opts . overridesProvider ,
471- } ,
440+ {
441+ bootstrappedFlags : opts . bootstrappedFlags ,
442+ bootstrappedOverrides : opts . bootstrappedOverrides ,
443+ expireTimeMs : opts . expireTimeMs ,
444+ staleTimeMs : opts . staleTimeMs ,
445+ staleWhileRevalidate : opts . staleWhileRevalidate ,
446+ timeoutMs : opts . timeoutMs ,
447+ fallbackFlags : opts . fallbackFlags ,
448+ offline : this . config . offline ,
449+ overridesProvider : opts . overridesProvider ,
450+ } ,
472451 ) ;
473452
474453 if (
@@ -544,7 +523,6 @@ export class ReflagClient {
544523 this . logger . error ( "error sending company" , e ) ;
545524 } ) ;
546525 }
547- this . config . bootstrapped = true ;
548526 }
549527
550528 this . logger . info (
0 commit comments