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

Add n_intervals_timestamp to Interval component #465

Closed
slishak opened this issue Feb 22, 2019 · 3 comments
Closed

Add n_intervals_timestamp to Interval component #465

slishak opened this issue Feb 22, 2019 · 3 comments

Comments

@slishak
Copy link

slishak commented Feb 22, 2019

If I have a callback that depends on a button and an interval, it is very difficult to tell whether the callback was triggered by the button being clicked or the interval being triggered. With multiple buttons, you can use n_clicks_timestamp to find which was most recently clicked. However, at the moment comparing whether an interval was triggered more recently than a button click is pretty messy. Is it possible to add in that property?

@alexcjohnson
Copy link
Collaborator

We have a better solution to this - which has already been merged and will be in the next release: callback context, that directly tells you which input(s) triggered the call plotly/dash#608

I'm not quite ready to say we'll deprecate all the _timestamp props, but I don't think we want to add any more until we see if there are cases the callback context doesn't cover.

@slishak
Copy link
Author

slishak commented Feb 22, 2019

Agreed, that looks like a much cleaner solution! Looking forward to deleting the workarounds in all my apps when that comes out :)

@alexcjohnson
Copy link
Collaborator

dash 0.38 is out with dash.callback_context (note the name - it's still called dash.callback in the changelog). We'll collect discussions about the future of *_timestamp properties in #467

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants