Skip to content
Discussion options

You must be logged in to vote

Look at the final section of the chapter you linked to, or at some of the examples in this repo that use server functions (like todo_app_sqlite):

Because a server function is just a plain Rust async function, it integrates perfectly with the async Leptos primitives we discussed earlier. So you can easily integrate your server functions with the rest of your applications:

  • Create resources that call the server function to load data from the server
  • Read these resources under or to enable streaming SSR and fallback states while data loads.

In other words, say you have a server function called my_server_function: just create a resource that calls it.

let async_data = create_resource(cx,

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@veta666
Comment options

Answer selected by veta666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants