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
| function useMultiFetch<T>(args: [string, RequestInit][]) { | |
| const [response, setResponse] = useState([] as [T | undefined, NS][]); | |
| const ref = useRef([] as [T | undefined, NS][]); | |
| const abortRef = useRef([] as AbortController[]); | |
| useEffect(() => { | |
| if (args.length === 0) return; | |
| const lendiff = args.length - ref.current.length; | |
| if (lendiff < 0) { | |
| ref.current = ref.current.slice(0, lendiff); |
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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type Node struct { | |
| Value int | |
| } |
OlderNewer