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

Call setState on React components once per dispatch #195

Closed
wants to merge 1 commit into from

Commits on Nov 17, 2015

  1. Call setState on React components once per dispatch

    The current ReactMixin implementation calls `reactor.observe`
    separately for each entry in the response to a React component's
    getDataBindings. If multiple pieces of bound data change in a single
    dispatch, Nuclear will call setState on the component for each of them
    and React will dutifully render each time. This means that the exact
    behavior of your component is dependent on the order in which you
    define your data bindings (aside from being bad for performance).
    
    This patch switches to a single `reactor.observe` call that includes
    all of the data bindings for the component.
    
    Fixes optimizely#193
    andrew-stripe committed Nov 17, 2015
    Configuration menu
    Copy the full SHA
    f0cdf53 View commit details
    Browse the repository at this point in the history