mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Review fixes
This commit is contained in:
parent
9cce9b572e
commit
12a93fc372
2 changed files with 2 additions and 7 deletions
|
@ -751,7 +751,7 @@ export const toIterable = <T>(
|
|||
export const toArray = <T>(
|
||||
values: readonly T[] | ReadonlyMap<string, T>,
|
||||
): T[] => {
|
||||
return Array.from(toIterable(values));
|
||||
return Array.isArray(values) ? values : Array.from(toIterable(values));
|
||||
};
|
||||
|
||||
export const isTestEnv = () => import.meta.env.MODE === ENV.TEST;
|
||||
|
|
|
@ -310,12 +310,7 @@ export class Store {
|
|||
}
|
||||
|
||||
private flushMicroActions() {
|
||||
const microActions = [...this.scheduledMicroActions];
|
||||
|
||||
// clear the queue first, in case it mutates in the meantime
|
||||
this.scheduledMicroActions = [];
|
||||
|
||||
for (const microAction of microActions) {
|
||||
for (const microAction of this.scheduledMicroActions) {
|
||||
try {
|
||||
microAction();
|
||||
} catch (error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue