Skip to content

Commit

Permalink
CHORE: 명칭 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ywkim95 committed Dec 17, 2024
1 parent 5a2935c commit 88b8ae3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/route/route.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HASH_ROUTER, ROUTER } from "../constants";
import { ErrorPage, LoginPage, MainPage, ProfilePage } from "../pages";

const abstractRoute = (path, router) => {
const routeFactory = (path, router) => {
switch (path) {
case router.main:
return () => MainPage();
Expand All @@ -14,6 +14,6 @@ const abstractRoute = (path, router) => {
}
};

export const hashRoute = (route) => abstractRoute(route, HASH_ROUTER);
export const hashRoute = (route) => routeFactory(route, HASH_ROUTER);

export const pathRoute = (route) => abstractRoute(route, ROUTER);
export const pathRoute = (route) => routeFactory(route, ROUTER);
2 changes: 1 addition & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as Store } from "./abstract.store.js";
export { default as Store } from "./store.js";
export { default as UserStore } from "./user.store.js";
export { default as PostStore } from "./post.store.js";
4 changes: 2 additions & 2 deletions src/store/post.store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Store from "./abstract.store.js";
import json from "./posts.json";
import Store from "./store.js";
import json from "../../public/posts.json";

class PostStore extends Store {
constructor(key = "post") {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/store/user.store.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Store from "./abstract.store";
import Store from "./store.js";

class UserStore extends Store {
constructor(key = "user") {
Expand Down
6 changes: 3 additions & 3 deletions src/validate/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UserStore } from "../store";
import { HASH_ROUTER, ROUTER } from "../constants";

const validateContainer = (path, router) => {
const validateFactory = (path, router) => {
const user = new UserStore().get();
if (!user && path === router.profile) {
return router.login;
Expand All @@ -14,9 +14,9 @@ const validateContainer = (path, router) => {
};

export const validateUserPath = (route) => {
return validateContainer(route, ROUTER);
return validateFactory(route, ROUTER);
};

export const validateUserHash = (route) => {
return validateContainer(route, HASH_ROUTER);
return validateFactory(route, HASH_ROUTER);
};

0 comments on commit 88b8ae3

Please sign in to comment.