We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fd8f9a commit 4797e47Copy full SHA for 4797e47
src/summary.ts
@@ -189,6 +189,18 @@ export const createSummary = function (this: MindElixirInstance) {
189
})
190
}
191
192
+export const createSummaryFrom = function (this: MindElixirInstance, summary: Omit<Summary, 'id'>) {
193
+ // now I know the goodness of overloading
194
+ const id = generateUUID()
195
+ const newSummary = { ...summary, id }
196
+ drawSummary(this, newSummary)
197
+ this.summaries.push(newSummary)
198
+ this.bus.fire('operation', {
199
+ name: 'createSummary',
200
+ obj: newSummary,
201
+ })
202
+}
203
+
204
export const removeSummary = function (this: MindElixirInstance, id: string) {
205
const index = this.summaries.findIndex(summary => summary.id === id)
206
if (index > -1) {
0 commit comments