{"action":"created","issue":{"url":"https://api.github.com/repos/heroku/react-refetch/issues/33","labels_url":"https://api.github.com/repos/heroku/react-refetch/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/heroku/react-refetch/issues/33/comments","events_url":"https://api.github.com/repos/heroku/react-refetch/issues/33/events","html_url":"https://github.com/heroku/react-refetch/issues/33","id":124828695,"number":33,"title":"Identity Requests (value attribute)","user":{"login":"ryanbrainard","id":966764,"avatar_url":"https://avatars.githubusercontent.com/u/966764?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanbrainard","html_url":"https://github.com/ryanbrainard","followers_url":"https://api.github.com/users/ryanbrainard/followers","following_url":"https://api.github.com/users/ryanbrainard/following{/other_user}","gists_url":"https://api.github.com/users/ryanbrainard/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanbrainard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanbrainard/subscriptions","organizations_url":"https://api.github.com/users/ryanbrainard/orgs","repos_url":"https://api.github.com/users/ryanbrainard/repos","events_url":"https://api.github.com/users/ryanbrainard/events{/privacy}","received_events_url":"https://api.github.com/users/ryanbrainard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/heroku/react-refetch/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-04T20:06:49Z","updated_at":"2016-01-17T03:28:45Z","closed_at":"2016-01-16T06:38:45Z","body":"Add a `value` attribute to requests (aka mappings) the return the `value` in lieu of actually fetching data from `url`. Requests with `value` are not allowed to also have a `value`.\r\n\r\nThis will support composable transformations, like this (from #21):\r\n\r\n```jsx\r\nconnect((props) => ({\r\n  data: {\r\n    url: \"/api/data\",\r\n    then: (rawValue) => ({ \r\n      value: rawValue.real_data \r\n    })\r\n  }\r\n}))(Component)\r\n```\r\n\r\nand will also provide a way to create static `PromiseState`s, like this (from #19):\r\n\r\n```jsx\r\nconnect((props) => ({\r\n    project: `/api/projects/${props.id}`,\r\n    updateProject: (data) => ({\r\n        project: { \r\n          url: `/api/projects/${props.id}`, \r\n          method: \"PATCH\", \r\n          body: data,\r\n          andThen: () => ({\r\n            projectUpdated: { \r\n              value: true // some static value of your choice\r\n            }\r\n          })\r\n        }\r\n    })\r\n}))\r\n```"},"comment":{"url":"https://api.github.com/repos/heroku/react-refetch/issues/comments/172286921","html_url":"https://github.com/heroku/react-refetch/issues/33#issuecomment-172286921","issue_url":"https://api.github.com/repos/heroku/react-refetch/issues/33","id":172286921,"user":{"login":"hnordt","id":1625399,"avatar_url":"https://avatars.githubusercontent.com/u/1625399?v=3","gravatar_id":"","url":"https://api.github.com/users/hnordt","html_url":"https://github.com/hnordt","followers_url":"https://api.github.com/users/hnordt/followers","following_url":"https://api.github.com/users/hnordt/following{/other_user}","gists_url":"https://api.github.com/users/hnordt/gists{/gist_id}","starred_url":"https://api.github.com/users/hnordt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hnordt/subscriptions","organizations_url":"https://api.github.com/users/hnordt/orgs","repos_url":"https://api.github.com/users/hnordt/repos","events_url":"https://api.github.com/users/hnordt/events{/privacy}","received_events_url":"https://api.github.com/users/hnordt/received_events","type":"User","site_admin":false},"created_at":"2016-01-17T03:28:45Z","updated_at":"2016-01-17T03:28:45Z","body":"Great @ryanbrainard. Simple and very efficient :clap: "}}