Fixes bug where changes were applied to the original flags objects from initialization. The object ldData.flags would retain a reference to the original flag set instead of being updated with the new merged object set in the change event.
In order to remediate this, we can grab the current state of the flags by passing a function to setLDData instead of an object.
For example, given this initial state:
flag1: on
flag2: off
flag3: off
After a changing flag2 to on:
flag1: on
flag2: on
flag3: off
After changing flag3 to on:
flag1: on
flag2: off <-- incorrectly set to original status!
flag3: on
Requirements
[ ] I have added test coverage for new or changed functionality
Fixes bug where changes were applied to the original flags objects from initialization. The object
ldData.flags
would retain a reference to the original flag set instead of being updated with the new merged object set in the change event.In order to remediate this, we can grab the current state of the flags by passing a function to
setLDData
instead of an object.For example, given this initial state:
After a changing flag2 to on:
After changing flag3 to on:
Requirements
Related issues
Describe the solution you've provided
Provide a clear and concise description of what you expect to happen.
Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.