#reactivity #reactive #state #stores #nested #signals #framework

reactive_stores

Stores for holding deeply-nested reactive state while maintaining fine-grained reactive tracking

4 releases

new 0.1.0-rc1 Nov 4, 2024
0.1.0-rc0 Oct 22, 2024
0.1.0-gamma3 Oct 14, 2024
0.1.0-gamma2 Oct 8, 2024

#1211 in Web programming

Download history 154/week @ 2024-10-03 191/week @ 2024-10-10 593/week @ 2024-10-17 802/week @ 2024-10-24 1389/week @ 2024-10-31

2,995 downloads per month
Used in 6 crates (via tachys)

MIT license

545KB
12K SLoC

Stores

Stores are a data structure for nested reactivity.

The reactive_graph crate provides primitives for fine-grained reactivity via signals, memos, and effects.

This crate extends that reactivity to support reactive access to nested dested, without the need to create nested signals.

Using the #[derive(Store)] macro on a struct creates a series of getters that allow accessing each field. Individual fields can then be read as if they were signals. Changes to parents will notify their children, but changing one sibling field will
not notify any of the others, nor will it require diffing those sibling fields (unlike earlier solutions using memoized “slices”).

This is published for use with the Leptos framework but can be used in any scenario where reactive_graph is being used for reactivity.

Dependencies

~2.6–4.5MB
~85K SLoC