(input: Omit<LineComment, "id" | "time">)
| 101 | const list = (file: string) => store.comments[file] ?? [] |
| 102 | |
| 103 | const add = (input: Omit<LineComment, "id" | "time">) => { |
| 104 | const next: LineComment = { |
| 105 | id: uuid(), |
| 106 | time: Date.now(), |
| 107 | ...input, |
| 108 | selection: cloneSelection(input.selection), |
| 109 | } |
| 110 | |
| 111 | batch(() => { |
| 112 | setStore("comments", input.file, (items) => [...(items ?? []), next]) |
| 113 | setFocus({ file: input.file, id: next.id }) |
| 114 | }) |
| 115 | |
| 116 | return next |
| 117 | } |
| 118 | |
| 119 | const remove = (file: string, id: string) => { |
| 120 | batch(() => { |
nothing calls this directly
no test coverage detected