(id)
| 153 | }); |
| 154 | }, |
| 155 | remove(id) { |
| 156 | return runInAction(() => { |
| 157 | const entity = store.findById(id); |
| 158 | |
| 159 | const didRemove = store.remove(id); |
| 160 | |
| 161 | if (!didRemove) return false; |
| 162 | |
| 163 | events.emit("removed", { |
| 164 | db, |
| 165 | entity: entity!, |
| 166 | type: "removed", |
| 167 | rollback() { |
| 168 | store.add(entity!); |
| 169 | }, |
| 170 | }); |
| 171 | |
| 172 | return didRemove; |
| 173 | }); |
| 174 | }, |
| 175 | update(id, input) { |
| 176 | return runInAction(() => { |
| 177 | const updateEvent = store.update(id, input); |