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

Clear dispatch token #52

Merged
merged 3 commits into from
Mar 6, 2017
Merged

Clear dispatch token #52

merged 3 commits into from
Mar 6, 2017

Conversation

colbyr
Copy link
Contributor

@colbyr colbyr commented Mar 6, 2017

It seems that in certain versions of React it was possible for
componentWillMount to be called more than once. facebook/react#6613

If that happened to a connected component, it would cause
dispatcher.unregister to be called again with a token that was already
unregistered causing an exception.

This nulls the token field so unregister can only be called once for a
given token.

/cc @marcneuwirth

TODOs

  • linter, checker, and test are passing
  • any new public modules are exported from src/GeneralStore.js
  • version numbers are up to date in package.json and bower.json
  • CHANGELOG.md is up to date

Colby Rabideau added 3 commits March 6, 2017 11:54
It seems that in certain versions of React it was possible for
`componentWillMount` to be called more than once. facebook/react#6613

If that happened to a `connect`ed component, it would cause
`dispatcher.unregister` to be called again with a token that was already
unregistered causing an exception.

This `null`s the token field so unregister can only be called once for a
given token.
@colbyr colbyr merged commit 0736f80 into master Mar 6, 2017
@colbyr colbyr deleted the clear-dispatch-token branch March 6, 2017 16:58
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.

1 participant