SpaceAppsXploration / xpreader-client

Chronos' News Reader Application JS client
http://apps.projectchronos.eu
Apache License 2.0
1 stars 3 forks source link

Experiment with lazy loading #31

Open lyoshida opened 8 years ago

lyoshida commented 8 years ago

"Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program's operation if properly and appropriately used. The opposite of lazy loading is eager loading."

As said in the conf, a good place to add lazy loading is in the loadArticles() function. After articles are retrieved, the code loops through the articles and make async calls to get the keywords associated to each of them (loadKeywords function in the articles collection).

The idea is to load keywords only for visible items + 5 next articles (to improve experience) as the use scroll down the page.

Lazy loading could be also used to embed tweets and fb posts.