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

Commit

Permalink
Simplified ediotr.initPlugins() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
f1ames committed Jan 29, 2019
1 parent 1879e98 commit 94f230c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,16 @@ export default class Editor {
/**
* Loads and initializes plugins specified in the config.
*
* @returns {Promise} A promise which resolves once the initialization is completed.
* @returns {Promise.<Array.<module:core/plugin~PluginInterface>>} returns.loadedPlugins A promise which resolves
* once the initialization is completed providing array of loaded plugins.
*/
initPlugins() {
const config = this.config;
const plugins = config.get( 'plugins' ) || [];
const removePlugins = config.get( 'removePlugins' ) || [];
const extraPlugins = config.get( 'extraPlugins' ) || [];

return Promise.resolve()
.then( () => {
const plugins = config.get( 'plugins' ) || [];
const removePlugins = config.get( 'removePlugins' ) || [];
const extraPlugins = config.get( 'extraPlugins' ) || [];

return this.plugins.init( plugins.concat( extraPlugins ), removePlugins );
} );
return this.plugins.init( plugins.concat( extraPlugins ), removePlugins );
}

/**
Expand Down

0 comments on commit 94f230c

Please sign in to comment.