Skip to content

Commit 566faa1

Browse files
refactor!: remove immediate option
1 parent 6b73551 commit 566faa1

File tree

11 files changed

+1
-55
lines changed

11 files changed

+1
-55
lines changed

docs/api/lazy-load.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ interface UnLazyLoadOptions {
6262
*/
6363
placeholderSize?: number
6464

65-
/**
66-
* Controls whether the image should be loaded immediately, or only when it
67-
* enters the viewport.
68-
*
69-
* @remarks
70-
* This option is intended primarily for internal usage in frontend framework
71-
* components that need to control when single images should be loaded.
72-
*
73-
* @default false
74-
*/
75-
immediate?: boolean
76-
7765
/**
7866
* A callback function to run when an image is loaded.
7967
*/

docs/integrations/nuxt.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ The `UnLazyImage` component accepts the following props:
8383
| `blurhash` | String | A BlurHash string representing the blurry placeholder image. |
8484
| `placeholderSize` | Number | The size of the longer edge (width or height) of the BlurHash image to be decoded, depending on the aspect ratio. This option only applies when the `blurhash` prop is used. |
8585
| `placeholderRatio` | Number | Aspect ratio (width / height) of the decoded BlurHash image. Only applies to SSR-decoded placeholder images from a BlurHash string. |
86-
| `immediate` | Boolean | A flag to indicate whether the image should be loaded immediately. |
8786
| `ssr` | Boolean | Whether the ThumbHash or BlurHash should be decoded on the server. Overrides the global module configuration if set. |
8887

8988
## Examples

docs/integrations/react.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ The `UnLazyImage` component accepts the following props:
5050
| `blurhash` | String | A BlurHash string representing the blurry placeholder image. |
5151
| `thumbhash` | String | A ThumbHash string representing the blurry placeholder image. |
5252
| `placeholderSize` | Number | The size of the longer edge (width or height) of the BlurHash image to be decoded, depending on the aspect ratio. This option only applies when the `blurhash` prop is used. |
53-
| `immediate` | Boolean | A flag to indicate whether the image should be loaded immediately. |
5453

5554
## Examples
5655

docs/integrations/solid.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ The `UnLazyImage` component accepts the following props:
5050
| `blurhash` | String | A BlurHash string representing the blurry placeholder image. |
5151
| `thumbhash` | String | A ThumbHash string representing the blurry placeholder image. |
5252
| `placeholderSize` | Number | The size of the longer edge (width or height) of the BlurHash image to be decoded, depending on the aspect ratio. This option only applies when the `blurhash` prop is used. |
53-
| `immediate` | Boolean | A flag to indicate whether the image should be loaded immediately. |
5453

5554
## Examples
5655

docs/integrations/svelte.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ The `UnLazyImage` component accepts the following props:
4848
| `blurhash` | String | A BlurHash string representing the blurry placeholder image. |
4949
| `thumbhash` | String | A ThumbHash string representing the blurry placeholder image. |
5050
| `placeholderSize` | Number | The size of the longer edge (width or height) of the BlurHash image to be decoded, depending on the aspect ratio. This option only applies when the `blurhash` prop is used. |
51-
| `immediate` | Boolean | A flag to indicate whether the image should be loaded immediately. |
5251

5352
## Examples
5453

docs/integrations/vue.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ The `UnLazyImage` component accepts the following props:
6565
| `blurhash` | String | A BlurHash string representing the blurry placeholder image. |
6666
| `thumbhash` | String | A ThumbHash string representing the blurry placeholder image. |
6767
| `placeholderSize` | Number | The size of the longer edge (width or height) of the BlurHash image to be decoded, depending on the aspect ratio. This option only applies when the `blurhash` prop is used. |
68-
| `immediate` | Boolean | A flag to indicate whether the image should be loaded immediately. |
6968

7069
## Examples
7170

packages/core/src/types.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ export interface UnLazyLoadOptions {
3535
*/
3636
placeholderSize?: number
3737

38-
/**
39-
* Controls whether the image should be loaded immediately, or only when it
40-
* enters the viewport.
41-
*
42-
* @remarks
43-
* This option is intended primarily for internal usage in frontend framework
44-
* components that need to control when single images should be loaded.
45-
*
46-
* @default false
47-
*/
48-
immediate?: boolean
49-
5038
/**
5139
* A callback function to run when an image is loaded.
5240
*/

packages/react/src/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ interface Props
1515
blurhash?: string
1616
/** A ThumbHash string representing the blurry placeholder image. */
1717
thumbhash?: string
18-
/**
19-
* A flag to indicate whether the image should be loaded immediately.
20-
* @default false
21-
*/
22-
immediate?: boolean
2318
}
2419

2520
export function UnLazyImage({
2621
autoSizes,
2722
blurhash,
2823
thumbhash,
2924
placeholderSize,
30-
immediate,
3125
...rest
3226
}: Props) {
3327
const target = useRef<HTMLImageElement | null>(null)
@@ -38,13 +32,12 @@ export function UnLazyImage({
3832
hash: thumbhash || blurhash,
3933
hashType: thumbhash ? 'thumbhash' : 'blurhash',
4034
placeholderSize,
41-
immediate,
4235
})
4336
return () => {
4437
cleanup()
4538
}
4639
}
47-
}, [blurhash, thumbhash, placeholderSize, immediate])
40+
}, [blurhash, thumbhash, placeholderSize])
4841

4942
return (
5043
<img

packages/solid/src/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ interface Props
1515
blurhash?: string
1616
/** A ThumbHash string representing the blurry placeholder image. */
1717
thumbhash?: string
18-
/**
19-
* A flag to indicate whether the image should be loaded immediately.
20-
* @default false
21-
*/
22-
immediate?: boolean
2318
}
2419

2520
export function UnLazyImage(props: Props) {
@@ -34,7 +29,6 @@ export function UnLazyImage(props: Props) {
3429
hash: props.thumbhash || props.blurhash,
3530
hashType: props.thumbhash ? 'thumbhash' : 'blurhash',
3631
placeholderSize: props.placeholderSize,
37-
immediate: props.immediate,
3832
})
3933

4034
onCleanup(() => {

packages/svelte/src/lib/UnLazyImage.svelte

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
/** A ThumbHash string representing the blurry placeholder image. */
1414
export let thumbhash: string | undefined = undefined
1515
export let placeholderSize: UnLazyLoadOptions['placeholderSize'] = 32
16-
/**
17-
* A flag to indicate whether the image should be loaded immediately.
18-
* @default false
19-
*/
20-
export let immediate = false
2116
2217
let target: HTMLImageElement | undefined
2318
let cleanup: (() => void) | undefined
@@ -34,7 +29,6 @@
3429
hash: thumbhash || blurhash,
3530
hashType: thumbhash ? 'thumbhash' : 'blurhash',
3631
placeholderSize,
37-
immediate,
3832
})
3933
}
4034

0 commit comments

Comments
 (0)