AutosaveConfig (autosave)
@ckeditor/ckeditor5-autosave/src/autosave
interface
The configuration of the autosave feature.
ClassicEditor
.create( editorElement, {
autosave: {
save( editor ) {
// The saveData() function must return a promise
// which should be resolved when the data is successfully saved.
return saveData( editor.getData() );
}
}
} );
.then( ... )
.catch( ... );
See all editor configuration options.
See also the demo of the autosave feature.
Filtering
Methods
-
save( editor ) → Promise.<*>
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.
ClassicEditor .create( editorElement, { autosave: { save( editor ) { return saveData( editor.getData() ); } } } ); .then( ... ) .catch( ... );
Parameters
editor : Editor
The editor instance.
Returns
Promise.<*>