atmosphere explorer

prettier

handle.invalid 67212d7e 8f4fdf4d

verified
+22 -16
+7 -1
src/components/video-player.tsx
··· 22 22 }); 23 23 24 24 return ( 25 - <video ref={video} class="max-h-80 max-w-[20rem]" controls playsinline onLoadedData={props.onLoad}> 25 + <video 26 + ref={video} 27 + class="max-h-80 max-w-[20rem]" 28 + controls 29 + playsinline 30 + onLoadedData={props.onLoad} 31 + > 26 32 <source type="video/mp4" /> 27 33 </video> 28 34 );
+15 -15
src/utils/hooks/debounced.ts
··· 1 - import { type Accessor, createEffect, createSignal, onCleanup } from 'solid-js'; 1 + import { type Accessor, createEffect, createSignal, onCleanup } from "solid-js"; 2 2 3 3 export const createDebouncedValue = <T>( 4 - accessor: Accessor<T>, 5 - delay: number, 6 - equals?: false | ((prev: T, next: T) => boolean), 4 + accessor: Accessor<T>, 5 + delay: number, 6 + equals?: false | ((prev: T, next: T) => boolean), 7 7 ): Accessor<T> => { 8 - const initial = accessor(); 9 - const [state, setState] = createSignal(initial, { equals }); 8 + const initial = accessor(); 9 + const [state, setState] = createSignal(initial, { equals }); 10 10 11 - createEffect((prev: T) => { 12 - const next = accessor(); 11 + createEffect((prev: T) => { 12 + const next = accessor(); 13 13 14 - if (prev !== next) { 15 - const timeout = setTimeout(() => setState(() => next), delay); 16 - onCleanup(() => clearTimeout(timeout)); 17 - } 14 + if (prev !== next) { 15 + const timeout = setTimeout(() => setState(() => next), delay); 16 + onCleanup(() => clearTimeout(timeout)); 17 + } 18 18 19 - return next; 20 - }, initial); 19 + return next; 20 + }, initial); 21 21 22 - return state; 22 + return state; 23 23 };