Skip to content

2 of 2: Update stores.mdx #666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/routes/concepts/stores.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Within Solid, these stores can spawn a collection of reactive signals, each corr

## Creating a store

Stores were intentionally designed to manage data structures like objects and arrays but are capable of handling other data types, such as strings and numbers.
Stores can manage many data types, including: objects, arrays, strings, and numbers.

Using JavaScript's [proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) mechanism, reactivity extends beyond just the top-level objects or arrays.
With stores, you can now target nested properties and elements within these structures to create a dynamic tree of reactive data.

Expand Down Expand Up @@ -251,7 +252,7 @@ setStore("users", store.users.length, {

### Range specification

With path syntax, you can specify a range of indices to update or modify to target a subset of the elements within the array for modification.
With path syntax, you can target a subset of elements to update or modify by specifying a range of indices.
You can do this using an array of values:

```jsx
Expand Down Expand Up @@ -353,7 +354,7 @@ Other collection types, such as JavaScript [Sets](https://developer.mozilla.org/
### Data integration with `reconcile`

When new information needs to be merged into an existing store `reconcile` can be useful.
`reconcile` will determine the differences between new and existing data, initiating updates only when there are _changed_ values which avoids unnecessary updates.
`reconcile` will determine the differences between new and existing data and initiate updates only when there are _changed_ values, thereby avoiding unnecessary updates.

```jsx
const { createStore, reconcile } from "solid-js/stores"
Expand Down