Skip to content

Commit

Permalink
Subject: Refactor buildArticles to avoid ui state changes
Browse files Browse the repository at this point in the history
Reason for Commit: issues #32 #26 #27
  • Loading branch information
bnjmnrsh committed Jan 6, 2024
1 parent 56898e2 commit b054cb3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/js/_build_articles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { snitiz } from './_helpers'
import { navActiveLink } from './_nav_active_link'
import { aSections } from './_section_array'
import { observer } from './_observer'

Expand All @@ -8,11 +7,8 @@ import { observer } from './_observer'
*
* @param object oData, the incoming API data.
*/
export const buildArticles = function (oData) {
export const buildArticlesUI = function (oData) {
const articleList = document.querySelector('#articles')
const loader = document.querySelector('#loader')
loader.style.opacity = 1
navActiveLink()

// prettier-ignore
articleList.innerHTML =
Expand Down Expand Up @@ -109,8 +105,6 @@ export const buildArticles = function (oData) {
return assembly
}).join('')

loader.style.opacity = 0

observer(
{ root: document.querySelector('#newsfeed-wrap'), threshold: 0.25 },
'.news-item'
Expand Down

0 comments on commit b054cb3

Please sign in to comment.