Created
January 2, 2021 12:19
-
-
Save lil12t/a4fe09bb2394affbb5c8bea896619b32 to your computer and use it in GitHub Desktop.
Wrods search history filter
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
const alreadySearched = useMemo( | |
() => | |
[...history] | |
.slice(0, MAX_ITEMS_PER_PAGE) | |
.filter((element) => | |
items.some((item) => | |
item.name.toLowerCase().includes(element.toLowerCase()), | |
), | |
), | |
[history, items], | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment