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>(
|
export const toArray = <T>(
|
||||||
values: readonly T[] | ReadonlyMap<string, T>,
|
values: readonly T[] | ReadonlyMap<string, T>,
|
||||||
): 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;
|
export const isTestEnv = () => import.meta.env.MODE === ENV.TEST;
|
||||||
|
|
|
@ -310,12 +310,7 @@ export class Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
private flushMicroActions() {
|
private flushMicroActions() {
|
||||||
const microActions = [...this.scheduledMicroActions];
|
for (const microAction of this.scheduledMicroActions) {
|
||||||
|
|
||||||
// clear the queue first, in case it mutates in the meantime
|
|
||||||
this.scheduledMicroActions = [];
|
|
||||||
|
|
||||||
for (const microAction of microActions) {
|
|
||||||
try {
|
try {
|
||||||
microAction();
|
microAction();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue