Created
June 7, 2022 14:28
-
-
Save adityatyagi/920e09a005c2a0ca2c9a71219159adff to your computer and use it in GitHub Desktop.
This file contains 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
// a sorting function that has some complex sorting algorithm | |
const sortedItems = useMemo(() => { | |
return items.sort((a,b) => { | |
// some elaborate sorting algorithm | |
return a-b; | |
}); | |
}, [items]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment