{"action":"created","issue":{"url":"https://api.github.com/repos/mauriciosoares/core.js/issues/25","labels_url":"https://api.github.com/repos/mauriciosoares/core.js/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/mauriciosoares/core.js/issues/25/comments","events_url":"https://api.github.com/repos/mauriciosoares/core.js/issues/25/events","html_url":"https://github.com/mauriciosoares/core.js/issues/25","id":53913185,"number":25,"title":"core.js -VS- global pub/sub","user":{"login":"markmarijnissen","id":1287693,"avatar_url":"https://avatars.githubusercontent.com/u/1287693?v=3","gravatar_id":"","url":"https://api.github.com/users/markmarijnissen","html_url":"https://github.com/markmarijnissen","followers_url":"https://api.github.com/users/markmarijnissen/followers","following_url":"https://api.github.com/users/markmarijnissen/following{/other_user}","gists_url":"https://api.github.com/users/markmarijnissen/gists{/gist_id}","starred_url":"https://api.github.com/users/markmarijnissen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markmarijnissen/subscriptions","organizations_url":"https://api.github.com/users/markmarijnissen/orgs","repos_url":"https://api.github.com/users/markmarijnissen/repos","events_url":"https://api.github.com/users/markmarijnissen/events{/privacy}","received_events_url":"https://api.github.com/users/markmarijnissen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mauriciosoares/core.js/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-09T20:48:25Z","updated_at":"2015-01-16T16:11:16Z","closed_at":null,"body":"I'm trying to understand core.js.\r\n\r\n* Every module has an `init` and `destroy`\r\n* Every module can `listen` and `notify` (i.e. a global pub/sub)\r\n* A module can be coupled to a DOM element.\r\n\r\nCorrect?\r\n\r\nI could implement the same with a global pub/sub system and a single Mediator:\r\n\r\n* Let every module emit a `created(name)` event when it is defined.\r\n* The Mediator listens to `created` events and keeps a list of module names.\r\n* `Mediator.start(xxxx)`: emits `started xxxx(DOMElement)` where `xxxx` is the module name. \r\n* `Mediator.stop(xxxx)`: emits `stopped xxxx` where `xxxx` is the module name.\r\n\r\nShould be the same functionality, only a different way to view it... right?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mauriciosoares/core.js/issues/comments/70276627","html_url":"https://github.com/mauriciosoares/core.js/issues/25#issuecomment-70276627","issue_url":"https://api.github.com/repos/mauriciosoares/core.js/issues/25","id":70276627,"user":{"login":"mauriciosoares","id":2321259,"avatar_url":"https://avatars.githubusercontent.com/u/2321259?v=3","gravatar_id":"","url":"https://api.github.com/users/mauriciosoares","html_url":"https://github.com/mauriciosoares","followers_url":"https://api.github.com/users/mauriciosoares/followers","following_url":"https://api.github.com/users/mauriciosoares/following{/other_user}","gists_url":"https://api.github.com/users/mauriciosoares/gists{/gist_id}","starred_url":"https://api.github.com/users/mauriciosoares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauriciosoares/subscriptions","organizations_url":"https://api.github.com/users/mauriciosoares/orgs","repos_url":"https://api.github.com/users/mauriciosoares/repos","events_url":"https://api.github.com/users/mauriciosoares/events{/privacy}","received_events_url":"https://api.github.com/users/mauriciosoares/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T16:11:16Z","updated_at":"2015-01-16T16:11:16Z","body":"I see, so instead of extending the entire Backbone library, I'd extend only what I need from backbone (views for example)?\r\n\r\nAnd even further, I could extend Core with a method created by my own that just returns an instance of a Backbone View? That looks like a better approach then the one I've showed you.\r\n\r\nJust one question, I don't quite get the `notify('createView', function() {});`, did you really meant `notify`?"}}