Source: svelte-imready/src/svelte-imready/useReadyElement.ts

  1. import { ImReadyReactiveProps } from "@egjs/imready";
  2. import { SvelteImReadyResult, useImReady } from "./useImReady";
  3. /**
  4. * Svelte hook to check if the images or videos are loaded. (only `useReadyElement`, `useReady` and `useError` are true) Since this is deprecated, use useImReady instead.
  5. * @ko 이미지와 비디오들이 로드가 됐는지 체크하는 svelte hook.(`useReadyElement`, `useReady`와 `useError`만 true) deprecated 되었으므로 useImReady를 이용해주세요.
  6. * @deprecated
  7. * @memberof SvelteImReady
  8. * @param - Svelte ImReady's props </ko>Svelte ImReady의 props.</ko>
  9. * @example
  10. * ```js
  11. * import { useReadyElement } from "@egjs/svelte-imready";
  12. *
  13. *
  14. * const {
  15. * register,
  16. * readyCount,
  17. * isReady,
  18. * hasError,
  19. * } = useReadyElement({
  20. * selector: "img",
  21. * });
  22. * // &lt;div use:register&gt;&lt;/div&gt;
  23. * ```
  24. */
  25. export function useReadyElement(
  26. props: Partial<ImReadyReactiveProps> = {}
  27. ): SvelteImReadyResult {
  28. return useImReady(props);
  29. }
comments powered by Disqus