-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Callback context #608
Callback context #608
Conversation
@T4rk1n great solution, and very nice architecture - I didn't know about Only question is about the name - I feel like |
Yes, flask.g is alive for the duration of the request only, so each callback get it's own "scope" managed.
That was also one of my concern, but I dismissed |
|
Fair points. I'm still not excited about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic! 💃 once dash-renderer is released with the changes so we can reference it in setup.py
(and put back regular references in dev-requirements
)
If you feel like making an RC for this you can, but I don't think it's necessary to do so just to get feedback. Once there is a release for it though we should let community.plot.ly
know, and make an issue in dash-docs
about it.
From discussion with @Bachibouzouk , the triggered inputs should also contains the value for a cleaner api.
|
This is awesome, when will it be released? |
dad46cc
to
0e90fc7
Compare
@matthijsramlab Just merged, going into next release. |
fix infinite loop
original PR below
Add a callback context object for the dash package.
dash.callback_context.inputs/states
a dict with the id and prop as key for the inputs/states value of a callback.dash.callback_context.triggered
which inputs has fired (calledsetProps
)These properties are only available inside a callback.
Basic example:
Closes #291, Closes #59