{"action":"created","issue":{"url":"https://api.github.com/repos/ably/ably-js/issues/346","repository_url":"https://api.github.com/repos/ably/ably-js","labels_url":"https://api.github.com/repos/ably/ably-js/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/ably/ably-js/issues/346/comments","events_url":"https://api.github.com/repos/ably/ably-js/issues/346/events","html_url":"https://github.com/ably/ably-js/issues/346","id":186312589,"number":346,"title":"Platform object","user":{"login":"mattheworiordan","id":43789,"avatar_url":"https://avatars.githubusercontent.com/u/43789?v=3","gravatar_id":"","url":"https://api.github.com/users/mattheworiordan","html_url":"https://github.com/mattheworiordan","followers_url":"https://api.github.com/users/mattheworiordan/followers","following_url":"https://api.github.com/users/mattheworiordan/following{/other_user}","gists_url":"https://api.github.com/users/mattheworiordan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattheworiordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattheworiordan/subscriptions","organizations_url":"https://api.github.com/users/mattheworiordan/orgs","repos_url":"https://api.github.com/users/mattheworiordan/repos","events_url":"https://api.github.com/users/mattheworiordan/events{/privacy}","received_events_url":"https://api.github.com/users/mattheworiordan/received_events","type":"User","site_admin":false},"labels":[{"id":19211548,"url":"https://api.github.com/repos/ably/ably-js/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":19211550,"url":"https://api.github.com/repos/ably/ably-js/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-31T15:25:26Z","updated_at":"2016-11-01T14:01:20Z","closed_at":null,"body":"As we are starting to extend out ably-js to support lots more platforms (NativeScript, Titanium, etc), I think our logic that is scattered around (where necessary) that evaluates statements like `if (isBrowser) { ... }` should be feature driven instead.\r\n\r\nSo I propose that prior to the NativeScript work being done, we consider introducing a new Platform abstract / default object, that is then extended based on the detected platform.  So instead of `isBrowser` we could do something like `if (Platform.supportsXHR())`, `if (Platform.supportWebsocketPings())`, if `Platform.supportsPushNotifications())` etc.\r\n\r\nWDYT?\r\n\r\nBTW. We could even make this object exposed (pseudo-privately) so that we could use it to more easily enable / disable functionality in tests."},"comment":{"url":"https://api.github.com/repos/ably/ably-js/issues/comments/257573589","html_url":"https://github.com/ably/ably-js/issues/346#issuecomment-257573589","issue_url":"https://api.github.com/repos/ably/ably-js/issues/346","id":257573589,"user":{"login":"SimonWoolf","id":5908687,"avatar_url":"https://avatars.githubusercontent.com/u/5908687?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonWoolf","html_url":"https://github.com/SimonWoolf","followers_url":"https://api.github.com/users/SimonWoolf/followers","following_url":"https://api.github.com/users/SimonWoolf/following{/other_user}","gists_url":"https://api.github.com/users/SimonWoolf/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonWoolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonWoolf/subscriptions","organizations_url":"https://api.github.com/users/SimonWoolf/orgs","repos_url":"https://api.github.com/users/SimonWoolf/repos","events_url":"https://api.github.com/users/SimonWoolf/events{/privacy}","received_events_url":"https://api.github.com/users/SimonWoolf/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T14:01:20Z","updated_at":"2016-11-01T14:01:20Z","body":"Sure, I've no objection to this"}}
{"actor":{"display_login":"SimonWoolf"}}