Skip to content

Commit 2d33fc2

Browse files
committed
update after review
1 parent df6874a commit 2d33fc2

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

dash/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
from . import html # noqa: F401,E402
2020
from . import dash_table # noqa: F401,E402
2121
from .version import __version__ # noqa: F401,E402
22-
from ._callback_context import callback_context, ctx # noqa: F401,E402
22+
from ._callback_context import callback_context # noqa: F401,E402
2323
from ._callback import callback, clientside_callback # noqa: F401,E402
2424
from ._get_paths import ( # noqa: F401,E402
2525
get_asset_url,
2626
get_relative_path,
2727
strip_relative_path,
2828
)
29+
ctx = callback_context

dash/_callback_context.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ def states(self):
5151
@has_context
5252
def triggered(self):
5353
"""
54-
Returns a list of all the Input props that changed and caused the callback to execute. It is empty when the callback is
55-
called on initial load, unless an Input prop got its value from another initial callback. Callbacks triggered
56-
by user actions typically have one item in triggered, unless the same action changes two props at once or
57-
the callback has several Input props that are all modified by another callback based on a single user action.
54+
Returns a list of all the Input props that changed and caused the callback to execute. It is empty when the
55+
callback is called on initial load, unless an Input prop got its value from another initial callback.
56+
Callbacks triggered by user actions typically have one item in triggered, unless the same action changes
57+
two props at once or the callback has several Input props that are all modified by another callback based on
58+
a single user action.
5859
5960
Example: To get the id of the component that triggered the callback:
6061
`component_id = ctx.triggered[0]['prop_id'].split('.')[0]`
@@ -72,10 +73,11 @@ def triggered(self):
7273
@has_context
7374
def triggered_prop_ids(self):
7475
"""
75-
Returns a dictionary of all the Input props that changed and caused the callback to execute. It is empty when the callback is
76-
called on initial load, unless an Input prop got its value from another initial callback. Callbacks triggered
77-
by user actions typically have one item in triggered, unless the same action changes two props at once or
78-
the callback has several Input props that are all modified by another callback based on a single user action.
76+
Returns a dictionary of all the Input props that changed and caused the callback to execute. It is empty when
77+
the callback is called on initial load, unless an Input prop got its value from another initial callback.
78+
Callbacks triggered by user actions typically have one item in triggered, unless the same action changes
79+
two props at once or the callback has several Input props that are all modified by another callback based
80+
on a single user action.
7981
8082
triggered_prop_ids (dict):
8183
- keys (str) : the triggered "prop_id" composed of "component_id.component_property"
@@ -287,4 +289,4 @@ def using_outputs_grouping(self):
287289

288290

289291
callback_context = CallbackContext()
290-
ctx = CallbackContext()
292+

0 commit comments

Comments
 (0)