{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/5585","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/5585/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/5585/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/5585/events","html_url":"https://github.com/facebook/flow/issues/5585","id":284917899,"number":5585,"title":"The point of $ObjMap","user":{"login":"pronebird","id":704044,"avatar_url":"https://avatars2.githubusercontent.com/u/704044?v=4","gravatar_id":"","url":"https://api.github.com/users/pronebird","html_url":"https://github.com/pronebird","followers_url":"https://api.github.com/users/pronebird/followers","following_url":"https://api.github.com/users/pronebird/following{/other_user}","gists_url":"https://api.github.com/users/pronebird/gists{/gist_id}","starred_url":"https://api.github.com/users/pronebird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pronebird/subscriptions","organizations_url":"https://api.github.com/users/pronebird/orgs","repos_url":"https://api.github.com/users/pronebird/repos","events_url":"https://api.github.com/users/pronebird/events{/privacy}","received_events_url":"https://api.github.com/users/pronebird/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-28T13:46:37Z","updated_at":"2018-03-13T10:18:32Z","closed_at":"2018-03-13T10:18:32Z","author_association":"NONE","body":"Hi,\r\n\r\nCan anyone explain the point of `$ObjMap` and what's this exercise with `F` parameter all about?\r\n\r\nFor example:\r\n\r\n```\r\ntype ExtractReturnType = <V>(() => V) => V\r\n\r\nfunction run<A, O: {[key: string]: () => A}>(o: O): $ObjMap<O, ExtractReturnType> {\r\n  return Object.keys(o).reduce((acc, k) => Object.assign(acc, { [k]: o[k]() }), {});\r\n}\r\n```\r\n\r\nWhy can't `$ObjMap` be used as `$ObjMap<TObject, TTransformedReturnValue>`?\r\n\r\nWhy does one need to do an `ExtractReturnType` dance and go through unnecessary hoops?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/372615606","html_url":"https://github.com/facebook/flow/issues/5585#issuecomment-372615606","issue_url":"https://api.github.com/repos/facebook/flow/issues/5585","id":372615606,"user":{"login":"pronebird","id":704044,"avatar_url":"https://avatars2.githubusercontent.com/u/704044?v=4","gravatar_id":"","url":"https://api.github.com/users/pronebird","html_url":"https://github.com/pronebird","followers_url":"https://api.github.com/users/pronebird/followers","following_url":"https://api.github.com/users/pronebird/following{/other_user}","gists_url":"https://api.github.com/users/pronebird/gists{/gist_id}","starred_url":"https://api.github.com/users/pronebird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pronebird/subscriptions","organizations_url":"https://api.github.com/users/pronebird/orgs","repos_url":"https://api.github.com/users/pronebird/repos","events_url":"https://api.github.com/users/pronebird/events{/privacy}","received_events_url":"https://api.github.com/users/pronebird/received_events","type":"User","site_admin":false},"created_at":"2018-03-13T10:18:32Z","updated_at":"2018-03-13T10:18:32Z","author_association":"NONE","body":"@TrySound alright I see. So basically the extraction function is a somewhat constraint that is when resolved produces the return type which can be useful in case if the object has an array of functions which return values we could capture then."}}
{"actor":{"display_login":"pronebird"}}