Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

refactor: import store

Christian Feiabc052977b3f
diff --git a/client/components/search-videos.js b/client/components/search-videos.js
index 7ac247e..786d82a 100644
--- a/client/components/search-videos.js
+++ b/client/components/search-videos.js
@@ -1,4 +1,7 @@
import { createVideoElement } from "/lib/utils.js"
+import Store from '/lib/store.js'
+const store = new Store()
+
class SearchVideos extends HTMLElement {
constructor () {
super()
diff --git a/client/lib/router.js b/client/lib/router.js
index 2fbe7af..ba5a93c 100644
--- a/client/lib/router.js
+++ b/client/lib/router.js
@@ -1,4 +1,6 @@
import { createVideoElement, applyShowBigPlayer, applyShowThumbnails } from "/lib/utils.js"
+import Store from '/lib/store.js'
+const store = new Store()
const routes = {
'/': { template: document.getElementById('main-template'), async initialize() {
diff --git a/client/main.js b/client/main.js
index d148a93..6859d7f 100644
--- a/client/main.js
+++ b/client/main.js
@@ -1,7 +1,6 @@
import Store from '/lib/store.js'
import { createVideoElement } from '/lib/utils.js'
const store = new Store()
-window.store = store
// app: sse updates and renders
const eventSource = new EventSource('/')