-
Notifications
You must be signed in to change notification settings - Fork 319
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedLooking for assistance on this issueLooking for assistance on this issuesolidRelated to core SolidRelated to core Solid
Description
📚 Subject area/topic
/concepts/stores.mdx
📋 Page(s) affected (or suggested, for new content)
It would be nice if this also showed how to deal with a top-level array in the store. These examples walk to the array as a property of the store object but it indicates that the store could also be an array and the syntax for dealing with a top level array seems like it would have to be different.
📋 Description of content that is out-of-date or incorrect
const [store, setStore] = createStore({
userCount: 3,
users: [ ... ],
})
setStore("users", (currentUsers) => [
...currentUsers,
{
id: 3,
username: "michael584",
location: "Nigeria",
loggedIn: false,
},
])```
If the example users array was the store itself (`createStore([...users])`) then wouldn't most of the modifying examples be different?
### 🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
_No response_
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedLooking for assistance on this issueLooking for assistance on this issuesolidRelated to core SolidRelated to core Solid