Bladeren bron

Docs: small docs fixes.

Piotr Jasiun 6 jaren geleden
bovenliggende
commit
099a4a075f

+ 1 - 1
packages/ckeditor5-watchdog/docs/features/watchdog.md

@@ -54,7 +54,7 @@ In other words, your goal is to create a watchdog instance and make the watchdog
 
 ### Controlling editor creation and destruction
 
-For more control over the creation and destruction of editor instances, you can use the mandatory {@link module:watchdog/watchdog~Watchdog#setCreator `Watchdog#setCreator()`} and the optional {@link module:watchdog/watchdog~Watchdog#setDestructor `Watchdog#setDestructor()`} methods:
+For more control over the creation and destruction of editor instances, you can use the {@link module:watchdog/watchdog~Watchdog#setCreator `Watchdog#setCreator()`} and, if needed, the {@link module:watchdog/watchdog~Watchdog#setDestructor `Watchdog#setDestructor()`} methods:
 
 ```js
 // Instantiate the watchdog manually (do not use the for() helper).

+ 9 - 1
packages/ckeditor5-watchdog/src/watchdog.js

@@ -193,7 +193,15 @@ export default class Watchdog {
 	 * Overrides the default destruction function, which destroys only the editor instance.
 	 * It expects a function that should return a promise or `undefined`.
 	 *
-	 *		watchdog.setDestructor( editor => editor.destroy() );
+	 *		watchdog.setDestructor( editor => {
+	 *			// Do something before the editor is destroyed.
+	 *
+	 *			return editor
+	 *				.destroy()
+	 *				.then( () => {
+	 *					// Do something after the editor is destroyed.
+	 *				} );
+	 *		} );
 	 *
 	 * @param {Function} destructor
 	 */