Added update options to hooks, similar to components, to customize the default behavior regarding updates.
For example, by default useSplitTreatments(['feature_flag_name'], attributes, userKey) will re-evaluate the feature flag when the SDK client is ready or ready from cache, but not when it is updated. To change this, call it as follows: useSplitTreatments(['feature_flag_name'], attributes, userKey, { updateOnSdkUpdate: true }).
React SDK
What did you accomplish?
Added update options to hooks, similar to components, to customize the default behavior regarding updates.
For example, by default
useSplitTreatments(['feature_flag_name'], attributes, userKey)
will re-evaluate the feature flag when the SDK client is ready or ready from cache, but not when it is updated. To change this, call it as follows:useSplitTreatments(['feature_flag_name'], attributes, userKey, { updateOnSdkUpdate: true })
.How do we test the changes introduced in this PR?
Added new asserts to unit tests.
Extra Notes