just-react icon indicating copy to clipboard operation
just-react copied to clipboard

关于极简react的useStateDemo的问题

Open yuqiuyu123 opened this issue 4 years ago • 0 comments
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逻辑不会执行?

yuqiuyu123 avatar Jun 22 '21 09:06 yuqiuyu123