{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/25","repository_url":"https://api.github.com/repos/lhorie/mithril.js","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/25/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/25/events","html_url":"https://github.com/lhorie/mithril.js/issues/25","id":29989086,"number":25,"title":"Sharing information between modules","user":{"login":"levitanong","id":869638,"avatar_url":"https://avatars.githubusercontent.com/u/869638?v=3","gravatar_id":"","url":"https://api.github.com/users/levitanong","html_url":"https://github.com/levitanong","followers_url":"https://api.github.com/users/levitanong/followers","following_url":"https://api.github.com/users/levitanong/following{/other_user}","gists_url":"https://api.github.com/users/levitanong/gists{/gist_id}","starred_url":"https://api.github.com/users/levitanong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levitanong/subscriptions","organizations_url":"https://api.github.com/users/levitanong/orgs","repos_url":"https://api.github.com/users/levitanong/repos","events_url":"https://api.github.com/users/levitanong/events{/privacy}","received_events_url":"https://api.github.com/users/levitanong/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lhorie/mithril.js/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-03-23T15:11:56Z","updated_at":"2016-05-24T17:21:37Z","closed_at":"2014-04-02T02:38:52Z","body":"When I make prototypes for webapps, I like making sample data generators in js (rather than in the database, because why even use databases in prototypes).\r\n\r\nMy data involves a list of users, and a list of government projects that they request. I generate the list of users first by pulling data from randomuser.me via m.request(), and then I make them generate the list of projects. These are methods within their own controllers (and their own modules), which I instantiate in another controller.\r\n\r\nBecause routing necessarily requires that I use different modules for each route, I'm at a loss at how to share this data between different modules. The only way I can think of is assigning it to a global variable\r\n\r\n```\r\nvar data = {}\r\ndata.users = new User.controller();\r\ndata.projects = new Project.controller();\r\ndata.users.genUsers(5).then(function(){data.projects.genProjects(50)})\r\n// genUsers and genProjects create the lists at data.users.list, and data.projects.list\r\n```\r\n\r\nAnd I'm trying to avoid this because global variables are yuck. Maybe my mindset is wrong? I'm too used to angular services.\r\n"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/221342799","html_url":"https://github.com/lhorie/mithril.js/issues/25#issuecomment-221342799","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/25","id":221342799,"user":{"login":"isiahmeadows","id":4483844,"avatar_url":"https://avatars.githubusercontent.com/u/4483844?v=3","gravatar_id":"","url":"https://api.github.com/users/isiahmeadows","html_url":"https://github.com/isiahmeadows","followers_url":"https://api.github.com/users/isiahmeadows/followers","following_url":"https://api.github.com/users/isiahmeadows/following{/other_user}","gists_url":"https://api.github.com/users/isiahmeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/isiahmeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isiahmeadows/subscriptions","organizations_url":"https://api.github.com/users/isiahmeadows/orgs","repos_url":"https://api.github.com/users/isiahmeadows/repos","events_url":"https://api.github.com/users/isiahmeadows/events{/privacy}","received_events_url":"https://api.github.com/users/isiahmeadows/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T17:21:37Z","updated_at":"2016-05-24T17:21:37Z","body":"And in the last case, if you think it's actually Mithril acting up, please file a separate issue."}}
{"actor":{"display_login":"isiahmeadows"}}