{"action":"closed","issue":{"url":"https://api.github.com/repos/esp/esp-js/issues/16","labels_url":"https://api.github.com/repos/esp/esp-js/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/esp/esp-js/issues/16/comments","events_url":"https://api.github.com/repos/esp/esp-js/issues/16/events","html_url":"https://github.com/esp/esp-js/issues/16","id":95337128,"number":16,"title":"Create functionality to create a model specific router","user":{"login":"KeithWoods","id":2853674,"avatar_url":"https://avatars.githubusercontent.com/u/2853674?v=3","gravatar_id":"","url":"https://api.github.com/users/KeithWoods","html_url":"https://github.com/KeithWoods","followers_url":"https://api.github.com/users/KeithWoods/followers","following_url":"https://api.github.com/users/KeithWoods/following{/other_user}","gists_url":"https://api.github.com/users/KeithWoods/gists{/gist_id}","starred_url":"https://api.github.com/users/KeithWoods/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KeithWoods/subscriptions","organizations_url":"https://api.github.com/users/KeithWoods/orgs","repos_url":"https://api.github.com/users/KeithWoods/repos","events_url":"https://api.github.com/users/KeithWoods/events{/privacy}","received_events_url":"https://api.github.com/users/KeithWoods/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-16T03:04:57Z","updated_at":"2015-07-16T16:03:46Z","closed_at":"2015-07-16T16:03:46Z","body":"Make a change to the `Router` to enable closing over the model id to ease usages for simple model scenarios and sub system models. For example we could easily implement a proxing router that you'd use like this:\r\n\r\n```\r\n// mySubSystemRouter.js\r\nimport esp from 'esp-js';\r\nvar router = new esp.Router();\r\nvar modelRouter = router.createModelRouter('mySybSystemModelId');\r\nexport default modelRouter;\r\n```\r\n\r\n`createModelRouter()` would simply returns an object that proxies the underlying router and passes the correct model id when publishing events and doesn't take a model id when observing the model. \r\n\r\nFor simple apps and indeed for sub systems that have their own model, this would negate the need to ever pass the model id nor router around. You'd simply `require` the correct router."}}