chore: lint

This commit is contained in:
amhsirak
2025-01-06 02:01:20 +05:30
parent 2a568ed631
commit b06db2e778

View File

@@ -26,7 +26,7 @@ class RAFScheduler {
this.frameId = requestAnimationFrame(() => { this.frameId = requestAnimationFrame(() => {
const callbacks = Array.from(this.queue); const callbacks = Array.from(this.queue);
this.queue.clear(); this.queue.clear();
callbacks.forEach(callback => { callbacks.forEach(callback => {
try { try {
callback(); callback();
@@ -37,7 +37,7 @@ class RAFScheduler {
this.isProcessing = false; this.isProcessing = false;
this.frameId = null; this.frameId = null;
if (this.queue.size > 0) { if (this.queue.size > 0) {
this.process(); this.process();
} }
@@ -87,12 +87,12 @@ class EventDebouncer {
if (this.lowPriorityQueue.length > 0) { if (this.lowPriorityQueue.length > 0) {
const callback = this.lowPriorityQueue.shift(); const callback = this.lowPriorityQueue.shift();
callback?.(); callback?.();
if (this.lowPriorityQueue.length > 0) { if (this.lowPriorityQueue.length > 0) {
this.process(); this.process();
} }
} }
this.processing = false; this.processing = false;
}); });
} }
@@ -282,7 +282,7 @@ const Canvas = React.memo(({ width, height, onCreateRef }: CanvasProps) => {
canvas.removeEventListener('wheel', handleMouseEvent); canvas.removeEventListener('wheel', handleMouseEvent);
canvas.removeEventListener('keydown', handleKeyboardEvent); canvas.removeEventListener('keydown', handleKeyboardEvent);
canvas.removeEventListener('keyup', handleKeyboardEvent); canvas.removeEventListener('keyup', handleKeyboardEvent);
scheduler.current.clear(); scheduler.current.clear();
debouncer.current.clear(); debouncer.current.clear();
measurementCache.current.clear(); measurementCache.current.clear();
@@ -329,30 +329,30 @@ const Canvas = React.memo(({ width, height, onCreateRef }: CanvasProps) => {
className="block" className="block"
/> />
<Suspense fallback={null}> <Suspense fallback={null}>
{state.datePickerInfo && ( {state.datePickerInfo && (
<DatePicker <DatePicker
coordinates={state.datePickerInfo.coordinates} coordinates={state.datePickerInfo.coordinates}
selector={state.datePickerInfo.selector} selector={state.datePickerInfo.selector}
onClose={() => dispatch({ onClose={() => dispatch({
type: 'BATCH_UPDATE', type: 'BATCH_UPDATE',
payload: { datePickerInfo: null } payload: { datePickerInfo: null }
})} })}
/> />
)} )}
{state.timePickerInfo && ( {state.timePickerInfo && (
<TimePicker <TimePicker
coordinates={state.timePickerInfo.coordinates} coordinates={state.timePickerInfo.coordinates}
selector={state.timePickerInfo.selector} selector={state.timePickerInfo.selector}
onClose={() => dispatch({ type: 'SET_TIME_PICKER', payload: null })} onClose={() => dispatch({ type: 'SET_TIME_PICKER', payload: null })}
/> />
)} )}
{state.dateTimeLocalInfo && ( {state.dateTimeLocalInfo && (
<DateTimeLocalPicker <DateTimeLocalPicker
coordinates={state.dateTimeLocalInfo.coordinates} coordinates={state.dateTimeLocalInfo.coordinates}
selector={state.dateTimeLocalInfo.selector} selector={state.dateTimeLocalInfo.selector}
onClose={() => dispatch({ type: 'SET_DATETIME_PICKER', payload: null })} onClose={() => dispatch({ type: 'SET_DATETIME_PICKER', payload: null })}
/> />
)} )}
</Suspense> </Suspense>
</div> </div>
); );