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
| /* | |
| Usage | |
| q := NewQueue() | |
| q.EnQueue(func() { | |
| time.Sleep(2 * time.Second) | |
| fmt.Println("Hello") | |
| }) |
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 { isEqual } from "lodash"; | |
| import { useEffect, useRef } from "react"; | |
| /** | |
| * A hook that executes a callback function only once when the component is mounted. | |
| * | |
| * @param {Function} fn - The callback function to be executed during the component's mount phase. | |
| * @return {void} This function does not return any value. | |
| */ | |
| export function useOnMount(fn: () => void) { |
OlderNewer