Skip to content

Commit

Permalink
docs: improvements in book - closes #1845 (#1856)
Browse files Browse the repository at this point in the history
  • Loading branch information
obioma authored Oct 9, 2023
1 parent 4251f6c commit a302257
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion docs/book/src/02_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,23 @@ cargo add leptos --features=csr

> Using `nightly` Rust, and the `nightly` feature in Leptos enables the function-call syntax for signal getters and setters that is used in most of this book.
>
> To use `nightly` Rust, you can run
> To use nightly Rust, you can either opt into nightly for all your Rust projects by running
>
> ```bash
> rustup toolchain install nightly
> rustup default nightly
> ```
>
> or only for this project
>
> > ```bash
> rustup toolchain install nightly
> cd <into your project>
> rustup override set nightly
> ```
>
> [See here for more details.](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
>
> If you’d rather use stable Rust with Leptos, you can do that too. In the guide and examples, you’ll just use the [`ReadSignal::get()`](https://docs.rs/leptos/latest/leptos/struct.ReadSignal.html#impl-SignalGet%3CT%3E-for-ReadSignal%3CT%3E) and [`WriteSignal::set()`](https://docs.rs/leptos/latest/leptos/struct.WriteSignal.html#impl-SignalGet%3CT%3E-for-ReadSignal%3CT%3E) methods instead of calling signal getters and setters as functions.
Make sure you've added the `wasm32-unknown-unknown` target so that Rust can compile your code to WebAssembly to run in the browser.
Expand Down
3 changes: 2 additions & 1 deletion docs/book/src/view/04_iteration.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ The fact that the _list_ is static doesn’t mean the interface needs to be stat
You can render dynamic items as part of a static list.

```rust
// create a list of N signals
// create a list of 5 signals
let length = 5;
let counters = (1..=length).map(|idx| create_signal(idx));

// each item manages a reactive view
Expand Down

0 comments on commit a302257

Please sign in to comment.