Sfoglia il codice sorgente

API docs improvements.

Maciej Bukowski 5 anni fa
parent
commit
3e0ce69076

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

@@ -14,8 +14,8 @@ The {@link module:watchdog/watchdog~Watchdog} utility allows you to do exactly t
 It should be noticed that the most "dangerous" places in the API - like `editor.model.change()`, `editor.editing.view.change()`, emitters - are covered with checks and `try-catch` blocks that allow detecting unknown errors and restart editor when they occur.
 
 Currently there are two available watchdogs, which can be used depending on your needs:
-* [editor watchdog](#editor-watchdog) - it fills the most basic scenario when only one editor is created
-* [context watchdog](#context-watchdog) - it
+* [editor watchdog](#editor-watchdog) - that fills the most basic scenario when only one editor is created,
+* [context watchdog](#context-watchdog) - that keeps an advanced structure of connected editors via te context feature running
 
 ## Usage
 
@@ -230,7 +230,7 @@ watchdog.setDestructor( async context => {
 // Initialize the context watchdog with the context configuration.
 await watchdog.create( contextConfig );
 
-// Add editor configuration.
+// Add editor configuration (or an array of editor configurations).
 await watchdog.add( {
 	id: 'editor1',
 	type: 'editor',

+ 3 - 4
packages/ckeditor5-watchdog/src/editorwatchdog.js

@@ -242,8 +242,7 @@ export default class EditorWatchdog extends Watchdog {
 	_save() {
 		const version = this._editor.model.document.version;
 
-		// Change may not produce an operation, so the document's version
-		// can be the same after that change.
+		// Operation may not result in a model change, so the document's version can be the same.
 		if ( version === this._lastDocumentVersion ) {
 			return;
 		}
@@ -285,8 +284,8 @@ export default class EditorWatchdog extends Watchdog {
 	}
 
 	/**
-	 * Traverses both structures to find out whether the error context is connected
-	 * with the current editor.
+	 * Traverses error context and the current editor to find out whether these structures are connected
+	 * via properties to each other.
 	 *
 	 * @protected
 	 * @param {module:utils/ckeditorerror~CKEditorError} error

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

@@ -48,7 +48,7 @@ export default class Watchdog {
 		 * * `ready` - a state when a user can interact with the instance,
 		 * * `crashed` - a state when an error occurs - it quickly changes to `initializing` or `crashedPermanently`
 		 * depending on how many and how frequency errors have been caught recently,
-		 * * `crashedPermanently` - a state when the watchdog stops reacting to errors and keeps the instance crashed,
+		 * * `crashedPermanently` - a state when the watchdog stops reacting to errors and keeps the item it is watching crashed,
 		 * * `destroyed` - a state when the instance is manually destroyed by the user after calling `watchdog.destroy()`
 		 *
 		 * @public