Methods
-
staticSvelteImReady.useImReady(props){SvelteImReadyResult}
-
Svelte hook to check if the images or videos are loaded.
이미지와 비디오들이 로드가 됐는지 체크하는 svelte hook.
-
props (default:
{}
) optionalType: Partial<ImReadyReactiveProps>Svelte ImReady's props Svelte ImReady의 props.
Svelte ImReady's props Svelte ImReady의 props.
Returns:
Type Description SvelteImReadyResult Example
import { useImReady } from "@egjs/svelte-imready"; const { register, isReady, isPreReady, preReadyCount, readyCount, totalCount, } = useImReady({ selector: "img", }); // <div use:register ></div>
-
-
staticSvelteImReady.usePreReady(props){SvelteImReadyResult}
-
Svelte hook to check if the images or videos are loaded. (only usePreReady and useError are true) Since this is deprecated, use useImReady instead.
이미지와 비디오들이 로드가 됐는지 체크하는 svelte hook.(usePreReady와 useError만 true) deprecated 되었으므로 useImReady를 이용해주세요.
-
props (default:
{}
) optionalType: Partial<ImReadyReactiveProps>Svelte ImReady's props Svelte ImReady의 props.
Svelte ImReady's props Svelte ImReady의 props.
Returns:
Type Description SvelteImReadyResult Example
import { usePreReady } from "@egjs/svelte-imready"; const { register, isPreReady, hasError, } = usePreReady({ selector: "img", }); // <div use:register></div>
- Deprecated
- Yes
-
-
staticSvelteImReady.usePreReadyElement(props){SvelteImReadyResult}
-
Svelte hook to check if the images or videos are loaded. (only
usePreReadyElement
,usePreReady
anduseError
are true) Since this is deprecated, use useImReady instead.이미지와 비디오들이 로드가 됐는지 체크하는 svelte hook.(
usePreReadyElement
,usePreReady
와useError
만 true) deprecated 되었으므로 useImReady를 이용해주세요.-
props (default:
{}
) optionalType: Partial<ImReadyReactiveProps>Svelte ImReady's props Svelte ImReady의 props.
Svelte ImReady's props Svelte ImReady의 props.
Returns:
Type Description SvelteImReadyResult Example
import { usePreReadyElement } from "@egjs/svelte-imready"; const { register, preReadyCount, isPreReady, hasError, } = usePreReadyElement({ selector: "img", }); // <div use:register></div>
- Deprecated
- Yes
-
-
staticSvelteImReady.useReady(props){SvelteImReadyResult}
-
Svelte hook to check if the images or videos are loaded. (only
useReady
anduseError
are true) Since this is deprecated, use useImReady instead.이미지와 비디오들이 로드가 됐는지 체크하는 react hook.(
useReady
와useError
만 true) deprecated 되었으므로 useImReady를 이용해주세요.-
props (default:
{}
) optionalType: Partial<ImReadyReactiveProps>Svelte ImReady's props Svelte ImReady의 props.
Svelte ImReady's props Svelte ImReady의 props.
Returns:
Type Description SvelteImReadyResult Example
import { useReady } from "@egjs/react-imready"; const { register, isReady, hasError, } = useReady({ selector: "img", }); // <div use:register></div>
- Deprecated
- Yes
-
-
staticSvelteImReady.useReadyElement(props){SvelteImReadyResult}
-
Svelte hook to check if the images or videos are loaded. (only
useReadyElement
,useReady
anduseError
are true) Since this is deprecated, use useImReady instead.이미지와 비디오들이 로드가 됐는지 체크하는 svelte hook.(
useReadyElement
,useReady
와useError
만 true) deprecated 되었으므로 useImReady를 이용해주세요.-
props (default:
{}
) optionalType: Partial<ImReadyReactiveProps>Svelte ImReady's props Svelte ImReady의 props.
Svelte ImReady's props Svelte ImReady의 props.
Returns:
Type Description SvelteImReadyResult Example
import { useReadyElement } from "@egjs/svelte-imready"; const { register, readyCount, isReady, hasError, } = useReadyElement({ selector: "img", }); // <div use:register></div>
- Deprecated
- Yes
-
Type Definitions
-
SvelteImReady.ImReadyPropsTSInterface
-
Properties:
Name Type Description prefix
string Prefix for data size attribute.
데이터 사이즈 속성의 접두사.
loaders
Record<string, new (target: HTMLElement, options: ImReadyLoaderOptions) => Loader> The loader class map that determines how to ready for the element.
element에 대해 어떻게 준비할지 결정하는 loader 클래스 맵.
selector
string useReadyElement
boolean useReady
boolean usePreReadyElement
boolean usePreReady
boolean useError
boolean -
SvelteImReady.ImReadyValueTSInterface
-
Properties:
Name Type Description register
(element: HTMLElement) => any Ref function that can register the element to be checked
체크할 엘리먼트를 등록할 수 있는 svelte directive
hasError
Writable<boolean> Whether there is an error in the element
해당 엘리먼트에 에러가 있는지 여부
errorCount
Writable<number> The number of elements with errors
에러가 있는 엘리먼트들의 개수
totalErrorCount
Writable<number> The total number of targets with errors
에러가 있는 타겟들의 총 개수
preReadyCount
Writable<number> Number of elements pre-ready
사전 준비된 엘리먼트들의 개수
readyCount
Writable<number> Number of elements ready
준비된 엘리먼트들의 개수
totalCount
Writable<number> Total number of elements
엘리먼트들의 총 개수
isPreReady
Writable<boolean> Whether all elements are pre-ready
모든 엘리먼트가 사전 준비가 끝났는지 여부
isReady
Writable<boolean> Whether all elements are ready
모든 엘리먼트가 준비가 끝났는지 여부
isPreReadyOver
Writable<boolean> Whether pre-ready is over
사전 준비가 끝났는지 여부