Closed meain closed 1 year ago
That's good idea, but maybe we can through create a new Recoil Atom to store user's input, and filter task when is not empty. Some thing like that:
// state/input.ts
import { atom } from "recoil";
export const inputState = atom({
key: 'input',
default: '',
});
useEffect(() => {
switch (tasksLoadable.state) {
case 'hasValue': {
const tasks = tasksLoadable.contents.filter((task: TaskEntityObject) => {
return task.content.includes(input);
});
setTasks(tasks);
break;
}
case 'hasError':
throw tasksLoadable.contents;
}
}, [tasksLoadable.state, tasksLoadable.contents, input]);
// ...
I plan to go through your PR and then modify it by the way above, hope you don't mind. Thank you for your contribution.
Somehow my brain ignored the use of recoil. My React skills are getting a bit rusty :D. Thanks for the plugin btw.
For now you can update to the latest version to use this feature.
:tada: This PR is included in version 1.12.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
This lets you search when inputting. It still retains ability to create tasks. One possible improvement could be clearing the input box when closing/hiding the plugin modal.