Skip to content

Instantly share code, notes, and snippets.

@adityatyagi
Created June 7, 2022 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adityatyagi/920e09a005c2a0ca2c9a71219159adff to your computer and use it in GitHub Desktop.
Save adityatyagi/920e09a005c2a0ca2c9a71219159adff to your computer and use it in GitHub Desktop.
// 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