poi-plugin-quest-info-2 0.9.15 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { useCallback } from 'react'
2
+ import { useThrottle } from 'react-use'
2
3
  import { useStore } from './store'
3
4
 
4
5
  export const useSearchInput = () => {
@@ -15,3 +16,15 @@ export const useSearchInput = () => {
15
16
  setSearchInput,
16
17
  }
17
18
  }
19
+
20
+ export const useStableSearchWords = () => {
21
+ const { searchInput } = useSearchInput()
22
+ const throttledSearchInput = useThrottle(searchInput)
23
+ const searchKeywords = throttledSearchInput
24
+ .split(' ')
25
+ // Remove empty string
26
+ .filter((i) => !!i)
27
+ .map((i) => i.toUpperCase())
28
+
29
+ return searchKeywords
30
+ }