Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

hub on callback function bind to app #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bmatusiak
Copy link
Contributor

it felt convenient to have the "hub" service 'on' function argument 'callback' to inherit architect

hub.on("ready",function(){
   var app = this;
});

hub.on("plugin",function(plugin){
   var app = this;
});

hub.on("service",function(name, service){
   var app = this;
});

@janjongboom
Copy link
Contributor

+1

@@ -410,6 +410,7 @@ function Architect(config) {
var services = app.services = {
hub: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are allowing plugins to access app, using imports, would it be better to do hub: app instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some plugins may already be called "app" and would confuse, and as for "hub" is already identified as a core architect plugin that "looks" to be barely used and could be used for "architect app" events for plugins, example plugin would be a testing plugin, using hub events to check plugins for test, and then could be removed without modifying plugin config files

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants