By
That is the twenty seventh in our DecEmber collection–”Countdown to The New 12 months: 31 Days of Ember Addons”. We plan to focus on a brand new addon every day till the brand new 12 months, and we hope you will be part of us for the enjoyable!
Day 27
For the twenty seventh version of Countdown to The New 12 months we will take a
have a look at ember-in-viewport
.
What It Does
Does your app use scroll occasion listeners or getBoundingClientRect
to find out if a component in your web page is within the consumer’s viewport? If that’s the case, you’ve gotten come throughout the proper addon so that you can observe DOM components!
Frequent use circumstances for ember-in-viewport
embrace lazy loading pictures, infinite scrolling (see ember-infinity
) and/or monitoring commercial impressions. It is a versatile and performant library to provide your customers the efficiency they want when visiting your website.
Latest additions have added our personal {{in-viewport}}
modifier, permitting you to “observe” components in template solely elements! See the Modifiers part for extra examples.
Why I Like It
ember-in-viewport
helps browsers again to IE11 through the use of both IntersectionObserver
or requestAnimationFrame
(fallback case) to observe the weather in your web page. In comparison with conventional strategies of manually observing DOM components, this addon encapsulates performance in a way more performant method. For instance, IntersectionObserver
occurs off the principle thread, supplying you with Observability with out the price. Furthermore, by reusing cases of those JavaScript APIs throughout related components in your web page, you’re free to make use of this addon for as many components in your web page as you need!
In case you are on the lookout for an excellent instance to make use of this addon with, we now have included a considerably sturdy, responsive, lazy loaded art work part in your enjoyment!
Do you employ ember-in-viewport
or one thing related? We might love to listen to about Ember addons you’re keen on for DecEmber within the feedback beneath!