fix(doc): spelling

This commit is contained in:
Valerio Ageno
2024-11-17 18:24:56 +01:00
parent 28ea1ca1df
commit fcb92c7f0b
2 changed files with 7 additions and 6 deletions
@@ -12,10 +12,10 @@ import Breadcrumbs, { Element } from '../../components/breadcrumbs'
# Application state
The main reason Tuono is fast it's because it loads just the features that are needed for the project.
The main reason Tuono is fast is that it loads just the features that are needed for the project.
To defined them you need to fill the `ApplicationState` struct in the `./src/main.rs` file and they will be automatically available
in all the handlers you will define across the application.
To define them, you need to fill the `ApplicationState` struct in the `./src/main.rs` file, and
they will be automatically available in all the handlers you will define across the application.
```rs
// src/main.rs
@@ -68,7 +68,7 @@ Let's fix these in the next section.
## Application state
Compared to the common Javascript runtimes Tuono is fast because only the features you need for your project will be loaded.
Compared to the common Javascript runtimes, Tuono is fast because only the features you need for your project will be loaded.
You can load them in the `ApplicationState` of your app inside the `./src/main.rs` file. This is the file that will be executed just once at the very beginning of your application.
@@ -98,7 +98,8 @@ serde = { version = "1.0.202", features = ["derive"] }
++ reqwest = "0.12.9" # the version might be different
```
> The `Cargo.toml` is the manifest file of your application in which handling the Rust's dependencies (similarly as the `package.json` for Javascript).
> The `Cargo.toml` is the manifest file of your application, in which you handle Rust's dependencies
> (similarly as the package.json for Javascript).
Now let's define the `ApplicationState` in the `./src/main.rs` file.
@@ -119,7 +120,7 @@ pub fn main() -> ApplicationState {
}
```
Now the `fetch: Client` argument is available in the above defined handler and the terminal should not complain anymore.
Now the `fetch: Client` argument is available in the above defined handler, and the terminal should not complain anymore.
Let's see in the next section how to show the fetched data on the browser.
## Handling the page UI