How does actions update the store? #1888
-
Both of these give the same result,
and
How does that work? In general, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Pinia doesn't do anything special with |
Beta Was this translation helpful? Give feedback.
Pinia doesn't do anything special with
map
. Yourmap
isn't actually doing anything to the array, it just returns the same object. It looks like the assignment to theobject
variable (object =
) is what is manipulating something in both cases, and that is probably the update you are actually seeing. This is known as a side effect, where the function is updating something outside of it.