pages/search: input handlers: init

This commit is contained in:
He4eT 2024-01-20 21:54:12 +01:00
commit 499bd4dceb
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,8 @@
export const attachInputHandlers = (store) => {
const searchBox = document.getElementById('searchbox')
const actionbox = document.getElementById('actionbox')
searchBox.addEventListener('input', (e) => {
store.actions.updateQuery(e.target.value)
})
}

View file

@ -1,7 +1,10 @@
import * as Store from './modules/store.js'
import * as dom from './modules/dom.js'
import * as inputHandlers from './modules/inputHandlers.js'
const store = Store.init({
tabs: browser.tabs,
onStateUpdate: dom.updateSearchResults,
})
void inputHandlers.attachInputHandlers(store)