SPA에서 History API로 직접 라우팅 구현하기 ②
지난 포스팅에 이어, 이번 글에서는 라우팅을 직접 구현하면서 마주한 문제들과 그 해결 과정을 따라간 사고의 흐름을 정리해보고자 한다.
1️⃣ 현재까지의 구현
export const router = function () {
const routes = {};
function addRoute(path, pageRenderer) {
routes[path] = pageRenderer;
}
function render(path)...
ddoit.hashnode.dev2 min read