Closed jalopez closed 5 years ago
hey guys! any chances to get this PR merged in the close future? would be happy to give you a hand if needed )
Hey @jalopez, thank you for your PR! I'm sorry that I took so long to get back to you, I think it was lost in the noise generated by Github notifications.
Released in v2.3.0 🎉
great!!!
Table of Contents
Description
This PR adds a new method in the emitter
calculateActiveVariant
that will force the calculation of the active variant of an experiment, even if it has not been rendered yet. It has implied some refactoring (take the activeVariant calculation outside theExperiment
component, so it can be called from both the component and the emitter)Motivation and Context
There are some scenarios where developer needs to know beforehand which will the variant of an experiment will be selected (before rendering it). There are some event trackers that need to receive the experiments and the selected variant just when the page loads, and before the experiment itself is rendered. To do so, there is a new method
calculateActiveVariant
inside the emitter that can be called at anytime and will set an active variant of the given experiment even if the associated component is not yet rendered.How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: