mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
Add support for custom global state (#111)
* feat: add 'has_main_file' to App struct * feat: handle custom state from the main.rs file * feat: update tutorial template with new setup * fix: apply clippy hints * feat: add ApplicationState mention to documentation website * feat: update version to v0.13.0
This commit is contained in:
@@ -10,4 +10,5 @@ path = ".tuono/main.rs"
|
||||
[dependencies]
|
||||
tuono_lib = { path = "../../crates/tuono_lib/"}
|
||||
serde = { version = "1.0.202", features = ["derive"] }
|
||||
reqwest = "0.12.9"
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
use reqwest::Client;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ApplicationState {
|
||||
pub fetch: Client,
|
||||
}
|
||||
|
||||
pub fn main() -> ApplicationState {
|
||||
let fetch = Client::new();
|
||||
return ApplicationState { fetch };
|
||||
}
|
||||
Reference in New Issue
Block a user