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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions architect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

on: function (name, callback) {
if(typeof(callback) == "function") callback = callback.bind(app);
app.on(name, callback);
}
}
Expand Down