Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

fix update behaviour for multiple properties #54

Merged
merged 6 commits into from
Jun 1, 2018
Merged

Conversation

chriddyp
Copy link
Member

@chriddyp chriddyp commented Apr 30, 2018

currently, if a component updates two properties in a single setProps call and a callback is listening to both of those properties, the callback will be called twice instead of once.

this pr fixes that behaviour.

updating multiple properties at once is uncommon but was recently discovered when adding n_clicks and n_clicks_timestamp to the dash_html_components library: plotly/dash-html-components#45

threaded is now True by default in flask 1.0 and `threaded=True` can’t
be set if `processes>1`
chriddyp added a commit to plotly/dash-html-components that referenced this pull request Apr 30, 2018
events have been broken since plotly/dash#232
@chriddyp
Copy link
Member Author

Could someone from @plotly/dash please review?

@bpostlethwaite bpostlethwaite self-requested a review April 30, 2018 14:26
Copy link
Member

@bpostlethwaite bpostlethwaite left a comment

Choose a reason for hiding this comment

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

Looks good 💃

* update, so keep outputObservers unique.
*/
if (!contains(outputId, outputObservers)) {
outputObservers.push(outputId);
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps in a future iteration outputObservers could become a Set or similar data structure that enforces uniqueness.

chriddyp added a commit to plotly/dash-html-components that referenced this pull request Jun 1, 2018
@chriddyp chriddyp merged commit 6216e8a into master Jun 1, 2018
@chriddyp chriddyp deleted the multi-input branch June 1, 2018 15:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants