-
-
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
ClientSide Callbacks Promise Handling #1364
Comments
@jmSfernandes - This is a great idea! Would you be interested in making this change as a pull request to Dash? Several of our recent clientside callbacks features have been written by community members. See e.g. |
If there was some guidances here i would be interested at taking a stab at implementing this. |
@Michael-fore the PRs @chriddyp linked above point to most of the relevant code, but for clarity: the file src/actions/callbacks.ts is where all of this takes place. handleClientside executes clientside callbacks and currently prohibits promises here whereas handleServerside always returns a promise because it involves a network request. The block that calls these functions would need to add an async case for clientside that looks like the serverside version, depending on the return value of the clientside function. We'll have to be careful how |
@alexcjohnson thanks for the quick and informative clarification! |
I second this feature request. My usecase involves having to call an API clientside due to data privacy restrictions. The backend is not allowed to see certain types of data. I found a workaround using synchronous requests using XMLHttpRequest, but this will not be feasible on a large application: |
It would be a nice funcionallity to be able to return promises in the clientside callbacks.
Right now it is impossible to make web requests in the clientside.
This would help to take some load from the server side, which would greatly improve the dash apps performance
Example of what I mean:
This raises this type of error in the Web Page:
I think this should be a feature to really consider in future releases.
I really like how dash lets you abstract from javascript, But it is still lacking the the ability to offload demanding jobs to the clientside...
The text was updated successfully, but these errors were encountered: