Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Docs: Autosave API docs corrected. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaTomanek committed May 9, 2019
1 parent 7973be9 commit e6c08c6
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/autosave.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,25 @@ export default class Autosave extends Plugin {
*
* The plugin can be in the following states:
*
* * synchronized - when all changes are saved
* * waiting - when the plugin is waiting for other changes before calling `adapter#save()` and `config.autosave.save()`
* * saving - when the provided save method is called and the plugin waits for the response
* * synchronized – When all changes are saved.
* * waiting – When the plugin is waiting for other changes before calling `adapter#save()` and `config.autosave.save()`.
* * saving – When the provided save method is called and the plugin waits for the response.
*
* @member {'synchronized'|'waiting'|'saving'} #state
*/
this.set( 'state', 'synchronized' );

/**
* Debounced save method. The `save` method is called the specified `waitingTime` after the `debouncedSave` is called,
* unless new action happens in the meantime.
* Debounced save method. The `save()` method is called the specified `waitingTime` after `debouncedSave()` is called,
* unless a new action happens in the meantime.
*
* @private
* @type {Function}
*/
this._debouncedSave = debounce( this._save.bind( this ), waitingTime );

/**
* Last document version.
* The last document version.
*
* @private
* @type {Number}
Expand All @@ -119,7 +119,7 @@ export default class Autosave extends Plugin {
this._domEmitter = Object.create( DomEmitterMixin );

/**
* The config of this plugins.
* The configuration of this plugins.
*
* @private
* @type {Object}
Expand Down Expand Up @@ -198,7 +198,7 @@ export default class Autosave extends Plugin {
}

/**
* Invokes remaining `_save` method call.
* Invokes the remaining `_save()` method call.
*
* @protected
*/
Expand All @@ -207,8 +207,8 @@ export default class Autosave extends Plugin {
}

/**
* If the adapter is set and new document version exists,
* `_save()` method creates a pending action and calls `adapter.save()` method.
* If the adapter is set and a new document version exists,
* the `_save()` method creates a pending action and calls the `adapter.save()` method.
* It waits for the result and then removes the created pending action.
*
* @private
Expand Down Expand Up @@ -250,7 +250,7 @@ export default class Autosave extends Plugin {
}

/**
* Save callbacks.
* Saves callbacks.
*
* @private
* @type {Array.<Function>}
Expand All @@ -275,14 +275,14 @@ mix( Autosave, ObservableMixin );
/**
* An interface that requires the `save()` method.
*
* Used by {@link module:autosave/autosave~Autosave#adapter}
* Used by {@link module:autosave/autosave~Autosave#adapter}.
*
* @interface module:autosave/autosave~AutosaveAdapter
*/

/**
* Method that will be called when the data changes. It should return a promise (e.g. in case of saving content to the database),
* so the `Autosave` plugin will wait for that action before removing it from pending actions.
* The method that will be called when the data changes. It should return a promise (e.g. in case of saving content to the database),
* so the autosave plugin will wait for that action before removing it from pending actions.
*
* @method #save
* @param {module:core/editor/editor~Editor} editor The editor instance.
Expand Down Expand Up @@ -323,7 +323,7 @@ mix( Autosave, ObservableMixin );
/**
* The callback to be executed when the data needs to be saved.
*
* This function must return a promise which should be which should be resolved when the data is successfully saved.
* This function must return a promise which should be resolved when the data is successfully saved.
*
* ClassicEditor
* .create( editorElement, {
Expand All @@ -342,7 +342,7 @@ mix( Autosave, ObservableMixin );
*/

/**
* The minimum amount of time that need to pass after last action to call the provided callback.
* The minimum amount of time that needs to pass after the last action to call the provided callback.
* By default it is 1000 ms.
*
* ClassicEditor
Expand Down

0 comments on commit e6c08c6

Please sign in to comment.