Skip to content

Commit 9bdcf0d

Browse files
authored
Merge branch 'main' into docs/add-package-scope-to-contributing
2 parents e70dda1 + 0be2110 commit 9bdcf0d

4 files changed

Lines changed: 18 additions & 22 deletions

File tree

README-ko_kr.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,10 @@ packages/
9797
## 라이선스
9898

9999
MIT © Viva Republica, Inc. 자세한 내용은 [LICENSE](./LICENSE)를 참고하세요.
100+
101+
<a title="Toss" href="https://toss.im">
102+
<picture>
103+
<source media="(prefers-color-scheme: dark)" srcset="https://static.toss.im/logos/png/4x/logo-toss-reverse.png">
104+
<img alt="Toss" src="https://static.toss.im/logos/png/4x/logo-toss.png" width="100">
105+
</picture>
106+
</a>

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,10 @@ We welcome contributions from everyone! Please check our contribution guide.
9797
## License
9898

9999
MIT © Viva Republica, Inc. See [LICENSE](./LICENSE) for details.
100+
101+
<a title="Toss" href="https://toss.im">
102+
<picture>
103+
<source media="(prefers-color-scheme: dark)" srcset="https://static.toss.im/logos/png/4x/logo-toss-reverse.png">
104+
<img alt="Toss" src="https://static.toss.im/logos/png/4x/logo-toss.png" width="100">
105+
</picture>
106+
</a>

docs/core/why-react-simplikit-matters.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function AutoCompleteInput() {
2626
const [results, setResults] = useState<SearchResult[]>([]);
2727
const [isLoading, setLoading] = useState(false);
2828
const [isOpen, setOpen] = useState(false);
29-
const searchTimeoutRef = useRef<NodeJS.Timeout>(null);
3029
const containerRef = useRef<HTMLDivElement>(null);
3130

3231
useEffect(() => {
@@ -44,17 +43,13 @@ function AutoCompleteInput() {
4443
}, []);
4544

4645
useEffect(() => {
47-
if (searchTimeoutRef.current) {
48-
clearTimeout(searchTimeoutRef.current);
49-
}
50-
5146
if (query.trim().length === 0) {
5247
setResults([]);
5348
return;
5449
}
5550

5651
setLoading(true);
57-
searchTimeoutRef.current = setTimeout(async () => {
52+
const timeoutId = setTimeout(async () => {
5853
try {
5954
const response = await fetch(`/api/search?q=${query}`);
6055
const data = await response.json();
@@ -66,11 +61,7 @@ function AutoCompleteInput() {
6661
}
6762
}, 300);
6863

69-
return () => {
70-
if (searchTimeoutRef.current) {
71-
clearTimeout(searchTimeoutRef.current);
72-
}
73-
};
64+
return () => clearTimeout(timeoutId);
7465
}, [query]);
7566

7667
return (

docs/ko/core/why-react-simplikit-matters.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function AutoCompleteInput() {
2626
const [results, setResults] = useState<SearchResult[]>([]);
2727
const [isLoading, setLoading] = useState(false);
2828
const [isOpen, setOpen] = useState(false);
29-
const searchTimeoutRef = useRef<NodeJS.Timeout>(null);
3029
const containerRef = useRef<HTMLDivElement>(null);
3130

3231
useEffect(() => {
@@ -44,17 +43,13 @@ function AutoCompleteInput() {
4443
}, []);
4544

4645
useEffect(() => {
47-
if (searchTimeoutRef.current) {
48-
clearTimeout(searchTimeoutRef.current);
49-
}
50-
5146
if (query.trim().length === 0) {
5247
setResults([]);
5348
return;
5449
}
5550

5651
setLoading(true);
57-
searchTimeoutRef.current = setTimeout(async () => {
52+
const timeoutId = setTimeout(async () => {
5853
try {
5954
const response = await fetch(`/api/search?q=${query}`);
6055
const data = await response.json();
@@ -66,11 +61,7 @@ function AutoCompleteInput() {
6661
}
6762
}, 300);
6863

69-
return () => {
70-
if (searchTimeoutRef.current) {
71-
clearTimeout(searchTimeoutRef.current);
72-
}
73-
};
64+
return () => clearTimeout(timeoutId);
7465
}, [query]);
7566

7667
return (

0 commit comments

Comments
 (0)