瀏覽代碼

Improved API docs.

Maciej Bukowski 6 年之前
父節點
當前提交
59ed27229c
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 8 0
      packages/ckeditor5-watchdog/docs/features/watchdog.md
  2. 2 2
      packages/ckeditor5-watchdog/src/watchdog.js

+ 8 - 0
packages/ckeditor5-watchdog/docs/features/watchdog.md

@@ -121,6 +121,14 @@ Both, the {@link module:watchdog/watchdog~Watchdog#constructor `Watchdog#constru
 * `minimumNonErrorTimePeriod` - An average amount of milliseconds between last editor errors (defaults to 5000). When the period of time between errors is lower than that and the `crashNumberLimit` is also reached the watchdog changes its state to `crashedPermanently` and it stops restarting the editor. This prevents an infinite restart loop.
 * `waitingTime` - A minimum number of milliseconds between saving editor data internally, (defaults to 5000).
 
+```js
+const watchdog = new Watchdog( {
+	minimumNonErrorTimePeriod: 2000,
+	crashNumberLimit: 4,
+	waitingTime: 1000
+} )
+```
+
 ## Limitations
 
 The CKEditor 5 watchdog listens to uncaught errors which can be associated with the editor instance created by that watchdog. Currently, these errors are {@link module:utils/ckeditorerror~CKEditorError `CKEditorError` errors} so ones explicitly thrown by the editor (by its internal checks). This means that not every runtime error which crashed the editor can be caught which, in turn, means that not every crash can be detected.

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

@@ -53,14 +53,14 @@ export default class Watchdog {
 		/**
 		 * @private
 		 * @type {Number}
-		 * @see {module:watchdog/watchdog~WatchdogConfig}
+		 * @see module:watchdog/watchdog~WatchdogConfig
 		 */
 		this._crashNumberLimit = typeof config.crashNumberLimit === 'number' ? config.crashNumberLimit : 3;
 
 		/**
 		 * @private
 		 * @type {Number}
-		 * @see {module:watchdog/watchdog~WatchdogConfig}
+		 * @see module:watchdog/watchdog~WatchdogConfig
 		 */
 		this._minimumNonErrorTimePeriod = typeof config.minimumNonErrorTimePeriod === 'number' ? config.minimumNonErrorTimePeriod : 5000;