From fd0212a142ba91f8e7427e659debd5c7e3f0c0b3 Mon Sep 17 00:00:00 2001 From: Andrew Grande Date: Thu, 20 Jul 2023 05:57:12 -0700 Subject: [PATCH] docs: typo in 15_global_state.md (#1395) Proofreading --- docs/book/src/15_global_state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/src/15_global_state.md b/docs/book/src/15_global_state.md index 6d2d949705..e17845a21b 100644 --- a/docs/book/src/15_global_state.md +++ b/docs/book/src/15_global_state.md @@ -136,7 +136,7 @@ view! { cx, In this example, clicking the button will cause the text inside `

` to be updated, cloning `state.name` again! Because signals are the atomic unit of reactivity, updating any field of the signal triggers updates to everything that depends on the signal. -There’s a better way. You can use take fine-grained, reactive slices by using [`create_memo`](https://docs.rs/leptos/latest/leptos/fn.create_memo.html) or [`create_slice`](https://docs.rs/leptos/latest/leptos/fn.create_slice.html) (which uses `create_memo` but also provides a setter). “Memoizing” a value means creating a new reactive value which will only update when it changes. “Memoizing a slice” means creating a new reactive value which will only update when some field of the state struct updates. +There’s a better way. You can take fine-grained, reactive slices by using [`create_memo`](https://docs.rs/leptos/latest/leptos/fn.create_memo.html) or [`create_slice`](https://docs.rs/leptos/latest/leptos/fn.create_slice.html) (which uses `create_memo` but also provides a setter). “Memoizing” a value means creating a new reactive value which will only update when it changes. “Memoizing a slice” means creating a new reactive value which will only update when some field of the state struct updates. Here, instead of reading from the state signal directly, we create “slices” of that state with fine-grained updates via `create_slice`. Each slice signal only updates when the particular piece of the larger struct it accesses updates. This means you can create a single root signal, and then take independent, fine-grained slices of it in different components, each of which can update without notifying the others of changes.