Skip to content

Commit 78a2462

Browse files
committed
lint - warning 제거
1 parent d6660f0 commit 78a2462

File tree

8 files changed

+14
-12
lines changed

8 files changed

+14
-12
lines changed

packages/lib/src/createObserver.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export const createObserver = () => {
88
listeners.add(fn);
99
};
1010

11-
const unsubscribe = (fn: Listener) => {
12-
listeners.delete(fn);
13-
};
11+
// const unsubscribe = (fn: Listener) => {
12+
// listeners.delete(fn);
13+
// };
1414

1515
const notify = () => listeners.forEach((listener) => listener());
1616

packages/lib/src/hocs/memo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import { type FunctionComponent } from "react";
22
import { shallowEquals } from "../equals";
33

44
export function memo<P extends object>(Component: FunctionComponent<P>, equals = shallowEquals) {
5+
console.log("memo", equals);
56
return Component;
67
}

packages/lib/src/hooks/useAutoCallback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AnyFunction } from "../types";
2-
import { useCallback } from "./useCallback";
3-
import { useRef } from "./useRef";
2+
// import { useCallback } from "./useCallback";
3+
// import { useRef } from "./useRef";
44

55
export const useAutoCallback = <T extends AnyFunction>(fn: T): T => {
66
return fn;

packages/lib/src/hooks/useRouter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { RouterInstance } from "../Router";
22
import type { AnyFunction } from "../types";
3-
import { useSyncExternalStore } from "react";
3+
// import { useSyncExternalStore } from "react";
44
import { useShallowSelector } from "./useShallowSelector";
55

66
const defaultSelector = <T, S = T>(state: T) => state as unknown as S;

packages/lib/src/hooks/useShallowSelector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useRef } from "react";
2-
import { shallowEquals } from "../equals";
1+
// import { useRef } from "react";
2+
// import { shallowEquals } from "../equals";
33

44
type Selector<T, S = T> = (state: T) => S;
55

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useState } from "react";
2-
import { shallowEquals } from "../equals";
2+
// import { shallowEquals } from "../equals";
33

4-
export const useShallowState = <T>(initialValue: Parameters<typeof useState<T>>[0]) => {
4+
// initValue의 타입(T | (() => T)은 임의로 지은 것이므로 이후 수정 필요할지도
5+
export const useShallowState = <T>(initialValue: T | (() => T)) => {
56
// useState를 사용하여 상태를 관리하고, shallowEquals를 사용하여 상태 변경을 감지하는 훅을 구현합니다.
67
return useState(initialValue);
78
};

packages/lib/src/hooks/useStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useSyncExternalStore } from "react";
1+
// import { useSyncExternalStore } from "react";
22
import type { createStorage } from "../createStorage";
33

44
type Storage<T> = ReturnType<typeof createStorage<T>>;

packages/lib/src/hooks/useStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { createStore } from "../createStore";
2-
import { useSyncExternalStore } from "react";
2+
// import { useSyncExternalStore } from "react";
33
import { useShallowSelector } from "./useShallowSelector";
44

55
type Store<T> = ReturnType<typeof createStore<T>>;

0 commit comments

Comments
 (0)