Created
September 23, 2017 10:00
-
-
Save adeyahya/4b9018848301a734c1d16e3f11259ede to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( 'IntersectionObserver' in window ) { | |
const observer = new IntersectionObserver(callback, options) | |
observer.observe($el) | |
} else { | |
import(/* webpackChunkName: "intersection-observer" */ 'intersection-observer').then(_ => { | |
const observer = new IntersectionObserver(callback, options) | |
observer.observe($el) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment