-
Just starting with Leptos and using the SSR Axum template. Coming from Axum originally, I am accustomed to using a global AppState struct for sharing database pools and such. I had a look around and saw nothing sound describing how to implement such a global app state quickly/easily. Am I missing something in the examples or the book perhaps? |
Beta Was this translation helpful? Give feedback.
Answered by
gbj
Feb 26, 2024
Replies: 1 comment 4 replies
-
In the current version I believe your state type is provide via context -- ie you can Agreed it should be documented better. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think you can add multiple kinds of state like that, although I'm surprised Axum lets it compile. I am not an expert with Axum by any means.
But I put together a working example like this, using a single state type and the
FromRef
pattern in Axum:app_state.rs
main.rs