This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ㄴㄴ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState } from "react"; | |
| export function useLocalStorage<T>( | |
| key: string, | |
| initialValue: T | |
| ): [T, (value: T | ((val: T) => T)) => void] { | |
| const [storedValue, setStoredValue] = useState<T>(() => { | |
| try { | |
| const item = window.localStorage.getItem(key); | |
| return item ? JSON.parse(item) : initialValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface CombinedStatus<T> { | |
| status: "IDLE" | "PENDING" | "SUCCESS" | "FAILURE"; | |
| data: T | null; | |
| } | |
| function useApi<ApiResultType extends object, Payload>( | |
| repoFunc: ( | |
| payload: Payload | |
| ) => Promise<ApiResultType> | |
| ) { | |
| const _repoFunc = useRef(repoFunc); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <queue> | |
| using namespace std; | |
| int solution(int N, vector<vector<int> > road, int K) { | |
| int answer = 0; | |
| int village[51][51]; | |
| int INF = 10000 * 50; | |
| bool visited[51]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import localItemContext, { | |
| setLocalItemValue, | |
| } from "#/context/localItemContext"; | |
| import { useReactiveVar } from "@apollo/client"; | |
| import { useCallback, useEffect } from "react"; | |
| type UseReactiveLocalItemReturnType = <V>( | |
| key: string, | |
| defaultValue?: V, | |
| ) => [V, (value: V | ((prevState: V) => V) | null) => void]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useCallback, useEffect, useRef } from 'react'; | |
| export function useSupportBack(listening: boolean, onBack: () => void) { | |
| const fnRef = useRef(onBack); | |
| const memoizedCallback = useCallback(() => { | |
| fnRef.current(); | |
| window.removeEventListener('popstate', memoizedCallback); | |
| }, []); | |
| useEffect(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect, useMemo, useRef, useState } from "react"; | |
| function App() { | |
| const data = Array.from({ length: 7 }); | |
| const [positions, setPositions] = useState< | |
| Array<{ left: number; top: number }> | |
| >([]); | |
| const containerRef = useRef<HTMLDivElement>(null); | |
| const heights = useRef<Array<number>>( | |
| Array.from({ length: 10 }, () => Math.random() * 801) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="ko"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>무거운 계산</title> | |
| </head> | |
| <body> | |
| <p>무거운 계산</p> |
OlderNewer