plugins can be direct references or factory functions

This commit is contained in:
Hakim El Hattab
2020-04-23 09:39:26 +02:00
parent c1b2e415db
commit 210fbb7646
8 changed files with 26 additions and 23 deletions

View File

@ -183,6 +183,11 @@ export default class Plugins {
plugin = arguments[1];
plugin.id = arguments[0];
}
// Plugin can optionally be a function which we call
// to create an instance of the plugin
else if( typeof plugin === 'function' ) {
plugin = plugin();
}
let id = plugin.id;