Skip to content

Commit 479fb33

Browse files
feat: expose updateSizesAttribute
1 parent 868f239 commit 479fb33

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/core/src/lazyLoad.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ export function createPlaceholderFromHash(
167167
// and need to be updated when their size changes
168168
const resizeElementStore = new WeakMap<HTMLImageElement | HTMLSourceElement, ResizeObserver>()
169169

170-
function updateSizesAttribute(element: HTMLImageElement | HTMLSourceElement, shouldUpdateOnResize = false) {
171-
const removeResizeObserver = (): void => {
170+
export function updateSizesAttribute(element: HTMLImageElement | HTMLSourceElement, shouldUpdateOnResize = false) {
171+
const removeResizeObserver = () => {
172172
const observerInstance = resizeElementStore.get(element)
173173
if (!observerInstance)
174174
return

packages/unlazy/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { autoSizes, createPlaceholderFromHash, isCrawler, isLazyLoadingSupported, lazyLoad, loadImage } from '@unlazy/core'
1+
export { autoSizes, createPlaceholderFromHash, isCrawler, isLazyLoadingSupported, lazyLoad, loadImage, updateSizesAttribute } from '@unlazy/core'
22
export type { UnLazyLoadOptions } from '@unlazy/core'

0 commit comments

Comments
 (0)