#634·pinia

Request for MapWritableState nested object access.

Author: davidboom95Created Aug 28, 2021Updated Aug 28, 2023
Labelsdiscussionfeature request

What problem is this solving

Modifying deeply nested properties in the state.

Proposed solution

javascript
// Object
...mapWritableState(useStore, {
     myCity: 'form.address.city',
})

// Array ( outputs the latest key as the variable name, in this case city)
...mapWritableState(useStore, ['form.address.city'])