{"action":"created","issue":{"url":"https://api.github.com/repos/Getline-Network/getline/issues/35","repository_url":"https://api.github.com/repos/Getline-Network/getline","labels_url":"https://api.github.com/repos/Getline-Network/getline/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/Getline-Network/getline/issues/35/comments","events_url":"https://api.github.com/repos/Getline-Network/getline/issues/35/events","html_url":"https://github.com/Getline-Network/getline/issues/35","id":275209147,"number":35,"title":"[getline.ts] Detect network from context and automatically reload client when it changes","user":{"login":"ritave","id":1614945,"avatar_url":"https://avatars0.githubusercontent.com/u/1614945?v=4","gravatar_id":"","url":"https://api.github.com/users/ritave","html_url":"https://github.com/ritave","followers_url":"https://api.github.com/users/ritave/followers","following_url":"https://api.github.com/users/ritave/following{/other_user}","gists_url":"https://api.github.com/users/ritave/gists{/gist_id}","starred_url":"https://api.github.com/users/ritave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritave/subscriptions","organizations_url":"https://api.github.com/users/ritave/orgs","repos_url":"https://api.github.com/users/ritave/repos","events_url":"https://api.github.com/users/ritave/events{/privacy}","received_events_url":"https://api.github.com/users/ritave/received_events","type":"User","site_admin":false},"labels":[{"id":756192185,"url":"https://api.github.com/repos/Getline-Network/getline/labels/api-change","name":"api-change","color":"ca30e5","default":false},{"id":723648767,"url":"https://api.github.com/repos/Getline-Network/getline/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-20T00:42:52Z","updated_at":"2017-11-23T12:01:29Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"A single provider can change the network it's operating on. Currently the network version needs to be entered in the Client constructor, which is redundant and forces a single network over the whole lifetime of the application. This is simply not true - for example you can change the network in the Metamask interface without affecting currently open browser window. By detecting network from the context of Web3 instead of requiring hardcoded value in the constructor we can better support multiple networks in the future.\r\n\r\nThe solution is to poll the network once in a while and reload the state when the change happens.\r\nOther idea is to document the need to do this and ask the user to reconstruct the whole Getline.ts context? In that case provide a helper function?"},"comment":{"url":"https://api.github.com/repos/Getline-Network/getline/issues/comments/346600385","html_url":"https://github.com/Getline-Network/getline/issues/35#issuecomment-346600385","issue_url":"https://api.github.com/repos/Getline-Network/getline/issues/35","id":346600385,"user":{"login":"ritave","id":1614945,"avatar_url":"https://avatars0.githubusercontent.com/u/1614945?v=4","gravatar_id":"","url":"https://api.github.com/users/ritave","html_url":"https://github.com/ritave","followers_url":"https://api.github.com/users/ritave/followers","following_url":"https://api.github.com/users/ritave/following{/other_user}","gists_url":"https://api.github.com/users/ritave/gists{/gist_id}","starred_url":"https://api.github.com/users/ritave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritave/subscriptions","organizations_url":"https://api.github.com/users/ritave/orgs","repos_url":"https://api.github.com/users/ritave/repos","events_url":"https://api.github.com/users/ritave/events{/privacy}","received_events_url":"https://api.github.com/users/ritave/received_events","type":"User","site_admin":false},"created_at":"2017-11-23T12:01:29Z","updated_at":"2017-11-23T12:01:29Z","author_association":"CONTRIBUTOR","body":"@q3k we could simplify it by getting the network once during construction. without polling afterwards. Manual input of network id is useless when we're providing a web3 provider anyways in the same constructor"}}
{"actor":{"display_login":"ritave"}}