From 9222d8ece3b436dc72141746fec435c87dee3c19 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 16 Jun 2021 13:47:41 -0400 Subject: [PATCH] docs: more docs on recoil --- packages/atoms/README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/atoms/README.md b/packages/atoms/README.md index d50f74012..9e5d31046 100644 --- a/packages/atoms/README.md +++ b/packages/atoms/README.md @@ -1,27 +1,23 @@

⚛ Atoms

- Official global state management for Dioxus + Global state for Dioxus

-Manage global state in Dioxus apps with composable atoms: +Atoms is a global state management toolkit for Dioxus, built on the concept of composable atoms of state: ```rust const COUNT: Atom = |_| 0; const Incr: FC<()> = |cx| { let (count, set_count) = Atoms::use_read_write(&cx, &COUNT); - cx.render(rsx!( - button { onclick: move |_| set_count(count + 1), "+" } - )) + cx.render(rsx!( button { onclick: move |_| set_count(count + 1), "+" } )) } const Decr: FC<()> = |cx| { let (count, set_count) = Atoms::use_read_write(&cx, &COUNT); - cx.render(rsx!( - button { onclick: move |_| set_count(count + 1), "-" } - )) + cx.render(rsx!( button { onclick: move |_| set_count(count - 1), "-" } )) } const App: FC<()> = |cx| {