Moving to a todo app

This commit is contained in:
Max Lynch
2020-12-24 13:46:48 -06:00
parent aecaa1f897
commit 0056d6fe81
14 changed files with 330 additions and 180 deletions
+12
View File
@@ -0,0 +1,12 @@
import Store from '.';
export const setDone = (list, item, done) => {
Store.update((s, o) => {
const listIndex = o.lists.findIndex(l => l === list);
const itemIndex = o.lists[listIndex].items.findIndex(i => i === item);
s.lists[listIndex].items[itemIndex].done = done;
if (list === o.selectedList) {
s.selectedList = s.lists[listIndex];
}
});
};