Skip to content

Commit a69c364

Browse files
committed
jsdoc: Document when/why to call the two toggle methods
1 parent e3baf70 commit a69c364

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/Task.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,12 @@ export class Task {
291291
}
292292

293293
/**
294-
* Toggles this task and returns the resulting task(s). If the
295-
* task is not recurring, it will return `[toggled]`.
294+
* Toggles this task and returns the resulting task(s).
295+
*
296+
* Use this method if you need to know which is the original (completed)
297+
* task and which is the new recurrence.
298+
*
299+
* If the task is not recurring, it will return `[toggled]`.
296300
*
297301
* Toggling can result in more than one returned task in the case of
298302
* recurrence. In this case, the toggled task will be returned
@@ -361,8 +365,13 @@ export class Task {
361365
}
362366

363367
/**
364-
* Toggles this task and returns the resulting task(s). If the
365-
* task is not recurring, it will return `[toggled]`.
368+
* Toggles this task and returns the resulting task(s).
369+
*
370+
* Use this method if the updated task(s) are to be saved,
371+
* as this honours the user setting to control the order
372+
* the tasks should be saved in.
373+
*
374+
* If the task is not recurring, it will return `[toggled]`.
366375
*
367376
* Toggling can result in more than one returned task in the case of
368377
* recurrence. In this case, the toggled task will be returned in

0 commit comments

Comments
 (0)