File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/routes/reference/store-utilities Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 88 - mutations
99version : " 1.0"
1010description : >-
11- Create a store modifier that applies changes by mutating a draft value .
11+ Create a store modifier that applies changes by mutating the current state through a helper proxy .
1212---
1313
14- ` produce ` creates a store modifier that applies changes by mutating a draft value .
14+ ` produce ` creates a store modifier that applies changes by mutating the current state through a helper proxy .
1515
1616## Import
1717
@@ -31,7 +31,7 @@ function produce<T>(fn: (state: T) => void): (state: T) => T;
3131
3232- ** Type:** ` (state: T) => void `
3333
34- Function that mutates the provided draft state.
34+ Function that mutates the provided proxy state.
3535
3636## Return value
3737
@@ -42,8 +42,8 @@ Store modifier function.
4242## Behavior
4343
4444- ` produce ` returns a function that can be passed to store setters or [ ` modifyMutable ` ] ( /reference/store-utilities/modify-mutable ) .
45- - The modifier receives a mutable draft of the current state.
46- - Nested properties can be changed inside the modifier .
45+ - The returned modifier mutates the passed state and returns that same state.
46+ - The helper is primarily for store objects and nested wrappable data .
4747
4848## Examples
4949
You can’t perform that action at this time.
0 commit comments