What is the best practice for asynchronously loading component data?

You can call a background task indirectly, i.e., call a server function that creates the background task, and returns the task handle. So, while the background task is busy populating a result (dictionary), the client can poll the handle (e.g., at timed intervals) to discover what new data items have been added.

See Communicating Back for more information.

Probably not as automated as you’d like, but at least it allows both ends to work simultaneously.

2 Likes