Skip to content

Commit

Permalink
Merge pull request #111 from inokawa/remove-promise-resolve
Browse files Browse the repository at this point in the history
Remove unnecessary Promise.resolve
  • Loading branch information
inokawa committed Jun 28, 2023
2 parents 091932e + 4e25268 commit 6e4bf68
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/core/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,8 @@ export const createVirtualStore = (
return new Promise((resolve, reject) => {
_scrollToQueue = [
() => {
// HACK: It should be resolved in the next microtask that is after React's render
Promise.resolve().then(() => {
resolve();
_scrollToQueue = undefined;
});
resolve();
_scrollToQueue = undefined;
},
reject,
];
Expand Down

0 comments on commit 6e4bf68

Please sign in to comment.