Skip to content

Commit

Permalink
refacotr: updateContent 함수 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
장원정 committed Dec 16, 2024
1 parent c3601ff commit b9754ab
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ const hashRoutes = {

const router = createRouter(routes);

function updateContent() {
router();
}

function submitEventHandler(e) {
e.preventDefault();
const form = e.target;
Expand All @@ -79,7 +75,6 @@ function submitEventHandler(e) {

new UserStore().setUser({ username, email, bio });
router("/profile");
updateContent();
}
}

Expand All @@ -98,6 +93,6 @@ function clickEventHandler(e) {
}
}

window.addEventListener("popstate", updateContent);
window.addEventListener("load", updateContent);
window.addEventListener("hashchange", updateContent);
window.addEventListener("popstate", () => router());
window.addEventListener("load", () => router());
window.addEventListener("hashchange", () => router());

0 comments on commit b9754ab

Please sign in to comment.