Skip to content

Commit

Permalink
remove _pendingValue
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jun 28, 2024
1 parent 0068260 commit 9158e3c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
9 changes: 1 addition & 8 deletions hooks/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ let currentHook = 0;
/** @type {Array<import('./internal').Component>} */
let afterPaintEffects = [];

let EMPTY = [];

// Cast to use internal Options type
const options = /** @type {import('./internal').Options} */ (_options);

Expand Down Expand Up @@ -60,7 +58,6 @@ options._render = vnode => {
if (hookItem._nextValue) {
hookItem._value = hookItem._nextValue;
}
hookItem._pendingValue = EMPTY;
hookItem._pendingArgs = hookItem._nextValue = undefined;
});
} else {
Expand All @@ -84,11 +81,7 @@ options.diffed = vnode => {
if (hookItem._pendingArgs) {
hookItem._args = hookItem._pendingArgs;
}
if (hookItem._pendingValue !== EMPTY) {
hookItem._value = hookItem._pendingValue;
}
hookItem._pendingArgs = undefined;
hookItem._pendingValue = EMPTY;
});
}
previousComponent = currentComponent = null;
Expand Down Expand Up @@ -159,7 +152,7 @@ function getHookState(index, type) {
});

if (index >= hooks._list.length) {
hooks._list.push({ _pendingValue: EMPTY });
hooks._list.push({});
}

return hooks._list[index];
Expand Down
1 change: 0 additions & 1 deletion mangle.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"$_list": "__",
"$_pendingEffects": "__h",
"$_value": "__",
"$_pendingValue": "__V",
"$_nextValue": "__N",
"$_original": "__v",
"$_args": "__H",
Expand Down

0 comments on commit 9158e3c

Please # to comment.