{"action":"closed","issue":{"url":"https://api.github.com/repos/recore/refast/issues/11","repository_url":"https://api.github.com/repos/recore/refast","labels_url":"https://api.github.com/repos/recore/refast/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/recore/refast/issues/11/comments","events_url":"https://api.github.com/repos/recore/refast/issues/11/events","html_url":"https://github.com/recore/refast/issues/11","id":276566634,"number":11,"title":"Function check is not good when using native async funcitons","user":{"login":"tommytroylin","id":3364271,"avatar_url":"https://avatars0.githubusercontent.com/u/3364271?v=4","gravatar_id":"","url":"https://api.github.com/users/tommytroylin","html_url":"https://github.com/tommytroylin","followers_url":"https://api.github.com/users/tommytroylin/followers","following_url":"https://api.github.com/users/tommytroylin/following{/other_user}","gists_url":"https://api.github.com/users/tommytroylin/gists{/gist_id}","starred_url":"https://api.github.com/users/tommytroylin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommytroylin/subscriptions","organizations_url":"https://api.github.com/users/tommytroylin/orgs","repos_url":"https://api.github.com/users/tommytroylin/repos","events_url":"https://api.github.com/users/tommytroylin/events{/privacy}","received_events_url":"https://api.github.com/users/tommytroylin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-24T09:58:03Z","updated_at":"2018-03-26T13:03:26Z","closed_at":"2018-03-26T13:03:25Z","author_association":"NONE","body":"test code:\r\n```javascript\r\nfunction isType(type) {\r\n  return obj => ({}.toString.call(obj) === `[object ${type}]`);\r\n}\r\nvar isFunction = isType('Function');\r\nconst ayncFunc = async function() {};\r\nconsole.log('is native async function function? ', isFunction(ayncFunc));\r\n```\r\n\r\nhttps://github.com/recore/refast/blob/8d1677364e9b8037293d7634695368617443ed12/src/lib/Component.jsx#L52\r\n\r\n\r\nnative async functions will fail on this function check and throw an error that action xxxx should be a function.\r\n\r\n```javascript\r\n({}).toString.call(async function() {}); // [object AsyncFunction]\r\n```\r\n\r\nsimply use `typeof ` should be good\r\n"}}
{"actor":{"display_login":"fengsx"}}