Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix oldFlags assignation order #22

Merged
merged 1 commit into from
May 14, 2020
Merged

Conversation

rstuven
Copy link
Contributor

@rstuven rstuven commented May 14, 2020

For example:

onChange: (oldFlags) => {
  if (oldFlags === this.flags) {
    console.log("After the first call to onChange, this condition is always true!");
  }
}

@@ -59,7 +59,6 @@ const BulletTrain = class {
traits.forEach(trait => {
userTraits[trait.trait_key.toLowerCase().replace(/ /g, '_')] = trait.trait_value
});
this.oldFlags = flags;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line and the next, in this order, are not helping to detect differences between them in the onChange callback, at least directly, without using another variable.

@kyle-ssg kyle-ssg merged commit 53c671e into Flagsmith:master May 14, 2020
@rstuven rstuven deleted the fix-old-flags branch May 15, 2020 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants