Flagsmith / flagsmith-js-client

Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/

Home Page:https://www.flagsmith.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Prevent side effects on `bulletTrain.init`

askielboe opened this issue · comments

We use this library in a react native app and wrap the onChange callback in an event channel using redux saga. Since we only subscribe to channel updates after initialization it would be great if there was an option to prevent API calls during bulletTrain initialization (as to not waste our paid API calls).

Currently we use a workaround setting disableCache: true as this will stop getFlags from being called on init, but this feels like sort of a hack.

Having an explicit way to call bulletTrain.init without side effects would be great! 🙏🏼

Ok yep, makes sense, will add this later today.

Apologies for the delay!

Added preventFetch option to init as of 0.83 of bullet-train-client and react-native-bullet-train