Skip to content

Commit

Permalink
const ITEM_TPLS_API = ./items.json now in index.js and calling it in …
Browse files Browse the repository at this point in the history
…itemsDisplay(ITEM_TPLS_API)
  • Loading branch information
chrisnajman committed Dec 16, 2023
1 parent d1662b4 commit 864ea2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion js/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const ITEM_TPLS_API = "./items.json"
import themeSwitcher from "./theme-switcher.js"
import articleHeaderIntersectionObserver from "./observers/article-header-intersection-observer.js"
import itemsFilter from "./items-filter.js"
Expand All @@ -6,4 +7,4 @@ import itemsDisplay from "./items-display.js"
themeSwitcher()
articleHeaderIntersectionObserver()
itemsFilter()
itemsDisplay()
itemsDisplay(ITEM_TPLS_API)
4 changes: 2 additions & 2 deletions js/items-display.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { itemsArray } from "./globals.js"
import lazyLoad from "./observers/lazy-load-images-intersection-observer.js"
const ITEM_TPLS_API = "items.json"
// const ITEM_TPLS_API = "items.json"

const itemsList = document.getElementById("items-list")
const itemTemplate = document.getElementById("item-template")

export default async function itemsDisplay() {
export default async function itemsDisplay(ITEM_TPLS_API) {
const loadingMessage = document.getElementById("loading-message")
try {
const response = await fetch(ITEM_TPLS_API)
Expand Down

0 comments on commit 864ea2d

Please sign in to comment.