chiyadev / genshin-schedule

🕑 Genshin farming scheduler
https://genshin.chiya.dev
MIT License
72 stars 17 forks source link

Implement Memory Search to fix issue #43

Closed lauslim12 closed 3 years ago

lauslim12 commented 3 years ago

Problem

Issue number #42.

Fix

I implemented your memory search class to the useDueTasks utility function. The useDueTasks function now searches according to the user's query before filtering it. I also used useMemo for memoization.

Results

I have included them in a reply in issue #42.

Closing

Thank you!

Resolves #42

luaneko commented 3 years ago

This is actually not correct. useDueTasks is supposed to return tasks that are due, and useFilteredTasks is supposed to return tasks filtered by the search query. This is to achieve separation of concerns.

Instead of modifying useDueTasks, the task list component needs to be modified to use both useDueTasks and useFilteredTasks.