-
-
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
Improved callback_context
#1952
Conversation
callback_context
dash/__init__.py
Outdated
@@ -19,7 +19,7 @@ | |||
from . import html # noqa: F401,E402 | |||
from . import dash_table # noqa: F401,E402 | |||
from .version import __version__ # noqa: F401,E402 | |||
from ._callback_context import callback_context # noqa: F401,E402 | |||
from ._callback_context import callback_context, ctx # noqa: F401,E402 |
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.
Does this need to be a separate instance? Can we just say ctx = callback_context
after all the imports, and remove the extra instantiation?
@alexcjohnson I completed the following:
Also, I removed the extra |
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! 💃
IDK whether this is the right spot. I'd just want to mention that there's a typo in this example: it says
|
@MattesR Thanks for your comment. I think the examples in the initial write-up for this PR were confusing because the names changed during review. For example I just updated the comment to remove all the examples here and point people to the ones in the announcement on the community forum. |
closes # #1818
#1054
See also: Community Forum Discussion
This PR adds features to
dash.callback_context
to make it easier to use:ctx
as an alias fordash.callback_context
Determining which input triggered a callback
The new features will replace boilerplate such as:
👉 See the Announcement in the forum for details and examples.