just-react
just-react copied to clipboard
关于极简react的useStateDemo的问题
trafficstars
if (hook.queue.pending) {
let firstUpdate = hook.queue.pending.next;
do {
const action = firstUpdate.action;
baseState = action(baseState);
firstUpdate = firstUpdate.next;
} while (firstUpdate !== hook.queue.pending)
hook.queue.pending = null;
}
hook.queue.pending = null;为空的话dispatchAction方法的else逻辑不会执行?