@genesislcap/foundation-utils
Advanced tools
Comparing version 13.1.0 to 13.2.0-pa-659.1
export * from './sync'; | ||
export * from './when-else'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,2 +9,3 @@ export type Listener<EventType> = (ev: EventType) => void; | ||
export declare const createObserver: <EventType>() => Observer<EventType>; | ||
export declare const respondToVisibility: (element: HTMLElement, callback: (arg0: boolean) => any) => void; | ||
//# sourceMappingURL=observer.d.ts.map |
export * from './sync'; | ||
export * from './when-else'; |
@@ -13,1 +13,12 @@ export const createObserver = () => { | ||
}; | ||
export const respondToVisibility = (element, callback) => { | ||
const options = { | ||
root: document.documentElement, | ||
}; | ||
const observer = new IntersectionObserver((entries) => { | ||
entries.forEach((entry) => { | ||
callback(entry.intersectionRatio > 0); | ||
}); | ||
}, options); | ||
observer.observe(element); | ||
}; |
{ | ||
"name": "@genesislcap/foundation-utils", | ||
"description": "Genesis Foundation Utils", | ||
"version": "13.1.0", | ||
"version": "13.2.0-pa-659.1", | ||
"sideEffects": false, | ||
@@ -93,3 +93,3 @@ "license": "SEE LICENSE IN license.txt", | ||
}, | ||
"gitHead": "39bf570c9614148441adcf214ce2a56ab7984174" | ||
"gitHead": "5f7cfea7d5fc30205cb5f930d6f69c0b72a12ccf" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
99365
144
1547
3