You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, when attempting to use a writable computed (computed({ get () { … }, set (value) { … } })) with mapWritableState, TS reports an error. I assume that this is because mapWritableState, unlike mapState, only allows state and not computeds.
Despite TypeScript complaining, it seems like it does work as expected at runtime (but I did not test extensively).
What problem is this solving
At the moment, when attempting to use a writable
computed
(computed({ get () { … }, set (value) { … } })
) withmapWritableState
, TS reports an error. I assume that this is becausemapWritableState
, unlikemapState
, only allows state and notcomputed
s.Despite TypeScript complaining, it seems like it does work as expected at runtime (but I did not test extensively).
https://play.pinia.vuejs.org/#eNqNVO9P2zAQ/VeOaFJSKXVATEyqYGKbmMQ+MDSm7cMyiZBci8GxI9tJO5X87zs7Pxo6hNZP9fm9u3vvct4GH6qKNTUGi+DU5JpXFkQmV2dpYE0avE8lLyulLWyhNnhjlUZoYalVCSFLclVLi5pZE06AZVb91Nxmd4IImd0RKi55RshU4sZjC1xmtSBOKgFyVVa1xWLRHQEYY/upoqGJGH6FMowhzDMplb3m+WP4e+Z4bZzKNpWnSaeGFNDBYlkJ4tMJ4JRLKgT2T4VOJm5sGkAzL1WBggK7jKQftluQ0PqEkyRBHHRy59QhezBKkn++7bS/IPNGIWnglbtIGiT+P0NTzu+0Whuy74HA1HUHPadhJAU2Vilh5lnFO9q9tZVZJEleSMJTp7zRTKJNZFUm/3DOT9gJO0oEv0uoUMJlgZvnZYgxL7D8n+wD9PyQHb1l73zW5rhPWrqs3neynWyxJldyyVd7prjhcoH6a2W5ks/NyYRQ6y8+ZnWNY4v5PeaPL8QfzKbr+loj2dfgRJbN9Appnu764ubKz3a8pAnXgtCvXH5Do0TteuxgH2tZUNsTnO/20s+Yy9V3c7GxKM0gyjU6fIW9zZ9ekb5r95gdT1zcLRZZOC4WrQuXe0s47NQIGtYoBo3LGNaZze9HNLUz3T8albG7xT6bVojCvgnasmgGZ7QK3ZY6iiQspY8OaeVc1FeJOphkTSZoXAPLU5RAJtQq6i9n0PbMLt9u5yjxoCDqbSKHXK7+BFTY1lrC7Zttn6297a460wGMI/ibBRiraUwTdi8A1z8cgMpVmTZ4KW3H8G+I+/ElRAcj7OkJuLnKrqIhMnOhA24+k//0Lo3hSSUYrKAih0OwBRQGXwYNSUZsL8t/GL1fvXh6leKpa+67IUTQ/gUzFOyv
Proposed solution
Allow
computed
s that are writable (WritableComputedRef
) to be used withinmapWritableState
.Describe alternatives you've considered
No response
The text was updated successfully, but these errors were encountered: