mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 14:44:12 +00:00
04fd2487b3
* feat(fullstack): add `render_handler_with_state` When using server functions, the current pattern to access state such as database connections is to use `register_server_fns_with_handler` on an Axum router and 'inject' the state into the context provided to the server function. However, this only affects function calls which go via the Axum router; SSR renders bypass this, and therefore don't have access to any state. This commit adds an alternative `render_handler` which accepts some additional state. That state is injected into the context in a similar manner to `register_server_fns_with_handler`. SSR renders can then proceed to run in the same way as HTTP calls. * Change state object to 'inject_state' callback Also add a compiling doctest example. * remove the explicit for<'a> lifetime * remove unused assets_path from render_handler_with_context example --------- Co-authored-by: Evan Almloff <evanalmloff@gmail.com> |
||
---|---|---|
.. | ||
autofmt | ||
check | ||
cli | ||
core | ||
core-macro | ||
desktop | ||
dioxus | ||
dioxus-tui | ||
extension | ||
fermi | ||
fullstack | ||
generational-box | ||
hooks | ||
hot-reload | ||
html | ||
interpreter | ||
liveview | ||
mobile | ||
native-core | ||
native-core-macro | ||
rink | ||
router | ||
router-macro | ||
rsx | ||
rsx-rosetta | ||
server-macro | ||
signals | ||
ssr | ||
web |