From 2817131278b3d7f8d05ae9a90353a544b7cafc0c Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Wed, 19 Oct 2022 16:34:28 -0400 Subject: [PATCH] Note the stable/nightly difference in docs --- README.md | 10 ++++++++++ leptos/src/lib.rs | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 3fb5688de..1c3181675 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,16 @@ Here are some resources for learning more about Leptos: - [API Documentation](https://docs.rs/leptos/latest/leptos/) (in progress) - Leptos Guide (in progress) +## `nightly` Note + +Most of the examples assume you’re using `nightly` Rust. If you’re on stable, note the following: + +1. You need to enable the `"stable"` flag in `Cargo.toml`: `leptos = { version = "0.0", features = ["stable"] } +2. `nightly` enables the function call syntax for accessing and setting signals. If you’re using `stable`, + you’ll just call `.get()`, `.set()`, or `.update()` manually. Check out the + [`counters-stable` example](https://github.com/gbj/leptos/blob/main/examples/counters-stable/src/main.rs) + for examples of the correct API. + ## FAQs ### Is it fast? diff --git a/leptos/src/lib.rs b/leptos/src/lib.rs index ace52fa0d..8d0f6ff18 100644 --- a/leptos/src/lib.rs +++ b/leptos/src/lib.rs @@ -11,6 +11,14 @@ //! //! And you can do all three of these **using the same Leptos code.** //! +//! # `nightly` Note +//! Most of the examples assume you’re using `nightly` Rust. If you’re on stable, note the following: +//! 1. You need to enable the `"stable"` flag in `Cargo.toml`: `leptos = { version = "0.0", features = ["stable"] } +//! 2. `nightly` enables the function call syntax for accessing and setting signals. If you’re using `stable`, +//! you’ll just call `.get()`, `.set()`, or `.update()` manually. Check out the +//! [`counters-stable` example](https://github.com/gbj/leptos/blob/main/examples/counters-stable/src/main.rs) +//! for examples of the correct API. +//! //! # Learning by Example //! //! These docs are a work in progress. If you want to see what Leptos is capable of, check out