You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the amazing library! I have a suggestion about result callbacks.
Currently, if you want to have a callback after a command, you can use the result_callback argument of @app.callback. This is not described in the doc and a bit of a hidden feature. Consider the following:
It works but the interface could look clearer. I am confused that the result callback has to be defined with the callback.
I would prefer to have either a dedicated @app.resultcallback (as click does). Or a parameter on callback @app.callback(result_callback=True). But I would definitely dissociate both callback definitions from each other.
Also, IMO this should be documented in the callback section of the doc. I was looking into this for a proper way to setup and close DB connections.
This discussion was converted from issue #204 on July 16, 2024 15:30.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks for the amazing library! I have a suggestion about result callbacks.
Currently, if you want to have a callback after a command, you can use the
result_callback
argument of@app.callback
. This is not described in the doc and a bit of a hidden feature. Consider the following:It works but the interface could look clearer. I am confused that the result callback has to be defined with the callback.
I would prefer to have either a dedicated
@app.resultcallback
(as click does). Or a parameter on callback@app.callback(result_callback=True)
. But I would definitely dissociate both callback definitions from each other.Also, IMO this should be documented in the callback section of the doc. I was looking into this for a proper way to setup and close DB connections.
Beta Was this translation helpful? Give feedback.
All reactions