Skip to content

Commit

Permalink
Allow plugins to be defined as functions and imported instead of glob…
Browse files Browse the repository at this point in the history
…ally namespaced
  • Loading branch information
loganvolkers committed Jul 20, 2018
1 parent 52a4832 commit 28a648e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ module.exports = (() => {

if (plugin) {
plugin(editor, config.pluginsOpts[pluginId] || {});
} else if (typeof pluginId === 'function') {
pluginId(editor, config.pluginsOpts[pluginId] || {});
} else {
console.warn(`Plugin ${pluginId} not found`);
}
Expand Down

0 comments on commit 28a648e

Please sign in to comment.