Due to the order of effects, the effect to initialize Statsig was not actually called until child components rendered. This means that if you did not waitForInitialization or waitForCache, it would be possible to call methods on the Statsig class before it was initialized. Our gate/config/experiment and even event logging hooks were okay, because they consume the StatsigContext and guard on initialization being called.
This updates logevent to:
1) not throw
2) batch up to 20 events pre initialize (and then log them once the internal js sdk instance is ready to consume them)
Due to the order of effects, the effect to initialize Statsig was not actually called until child components rendered. This means that if you did not waitForInitialization or waitForCache, it would be possible to call methods on the Statsig class before it was initialized. Our gate/config/experiment and even event logging hooks were okay, because they consume the StatsigContext and guard on initialization being called.
This updates logevent to: 1) not throw 2) batch up to 20 events pre initialize (and then log them once the internal js sdk instance is ready to consume them)