mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
d835fe7358
commit
132d5fae2c
1 file changed
+1
-1
@@ -152,7 +152,7 @@ export class StorageHelper<T> {
|
|||||||
const nextValue = produce<T>(this.toJSON(), (draft: Draft<T>) => {
|
const nextValue = produce<T>(this.toJSON(), (draft: Draft<T>) => {
|
||||||
|
|
||||||
if (typeof value == "function") {
|
if (typeof value == "function") {
|
||||||
const newValue = value(draft) as Draft<T>;
|
const newValue = value(draft);
|
||||||
|
|
||||||
// merge returned plain objects from `value-as-callback` usage
|
// merge returned plain objects from `value-as-callback` usage
|
||||||
// otherwise `draft` can be just modified inside a callback without returning any value (void)
|
// otherwise `draft` can be just modified inside a callback without returning any value (void)
|
||||||
|
|||||||
Reference in new issue
Block a user