惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
L
LangChain Blog
C
Check Point Blog
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
美团技术团队
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog
G
Google Developers Blog
The Cloudflare Blog
P
Proofpoint News Feed

Ember.js Blog

Ember 7.0 Released Announcing the Official TypeScript Types Public Preview Accessibility Working Group Update The 2020 Ember Roadmap Countdown to The New Year - Built-in Addons Countdown to The New Year - Ember Exam Countdown to The New Year - Ember Code Snippet Countdown to The New Year - Ember Changeset Countdown to The New Year - Ember CLI Update Countdown to The New Year - Ember Template Invocation Location Countdown to The New Year - Ember CLI TypeScript Countdown to The New Year - Ember Bootstrap and Ember Paper Countdown to The New Year - Ember CSS Modules Countdown to The New Year - Ember Mapbox GL Countdown to The New Year - Ember Shepherd Countdown to The New Year - Ember Template Lint Countdown to The New Year - Ember Composable Helpers Countdown to The New Year - Ember Leaflet Countdown to The New Year - Ember Intl Countdown to The New Year - Ember Test Selectors Countdown to The New Year - Ember Power Select Countdown to The New Year - Ember Simple Auth Countdown to The New Year - Ember SVG Jar Countdown to The New Year - Ember Page Title Countdown to The New Year- Ember A11Y Testing Countdown to The New Year - Ember Angle Brackets Codemod Countdown to The New Year - Ember CLI Sass Countdown to The New Year - Ember Animated Countdown to The New Year - Ember Auto Import Countdown to The New Year - Ember Concurrency
Countdown to The New Year - Ember In Viewport
2019-12-27 · via Ember.js Blog

– By Scott Newcomer

This is the 27th in our DecEmber series–"Countdown to The New Year: 31 Days of Ember Addons". We plan to highlight a new addon each day until the new year, and we hope you'll join us for the fun!

Day 27

For the 27th edition of Countdown to The New Year we're going to take a look at ember-in-viewport.

What It Does

Does your app use scroll event listeners or getBoundingClientRect to determine if an element on your page is in the user's viewport? If so, you have come across the perfect addon for you to observe DOM elements!

Common use cases for ember-in-viewport include lazy loading images, infinite scrolling (see ember-infinity) and/or tracking advertisement impressions. This is a flexible and performant library to give your users the performance they need when visiting your site.

Recent additions have added our own {{in-viewport}} modifier, allowing you to "observe" elements in template only components! See the Modifiers section for more examples.

Why I Like It

ember-in-viewport supports browsers back to IE11 by using either IntersectionObserver or requestAnimationFrame (fallback case) to monitor the elements on your page. Compared to traditional methods of manually observing DOM elements, this addon encapsulates functionality in a much more performant manner. For example, IntersectionObserver happens off the main thread, giving you Observability without the cost. Moreover, by reusing instances of these JavaScript APIs across similar elements on your page, you are free to use this addon for as many elements on your page as you want!

If you are looking for a good example to use this addon with, we have included a somewhat robust, responsive, lazy loaded artwork component for your enjoyment!

Do you use ember-in-viewport or something similar? We'd love to hear about Ember addons you love for DecEmber in the comments below!