{"action":"created","comment":{"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments/90628729","pull_request_review_id":11147240,"id":90628729,"diff_hunk":"@@ -0,0 +1,149 @@\n+module Example exposing (..)\n+\n+import Html\n+import Json.Decode as Decode\n+import Json.Encode as Encode\n+import Kinto\n+\n+\n+-- Define what our Kinto records will look like for a Todo list.\n+\n+\n+type alias Todo =\n+    { id : String\n+    , title : Maybe String\n+    , description : Maybe String\n+    , last_modified : Int\n+    }\n+\n+\n+\n+-- And how to decode from a Kinto record to a Todo...\n+\n+\n+decodeTodo : Decode.Decoder Todo\n+decodeTodo =\n+    (Decode.map4 Todo\n+        (Decode.field \"id\" Decode.string)\n+        (Decode.maybe (Decode.field \"title\" Decode.string))\n+        (Decode.maybe (Decode.field \"description\" Decode.string))\n+        (Decode.field \"last_modified\" Decode.int)\n+    )\n+\n+\n+\n+-- And how to encode Todo data to send to Kinto.\n+\n+\n+encodeData : Maybe String -> Maybe String -> Encode.Value\n+encodeData title description =\n+    Encode.object\n+        [ ( \"title\", Encode.string (Maybe.withDefault \"\" title) )\n+        , ( \"description\", Encode.string (Maybe.withDefault \"\" description) )\n+        ]\n+\n+\n+\n+-- Configure a Kinto client: the server url and authentication\n+\n+\n+client : Kinto.Client\n+client =\n+    Kinto.client\n+        \"https://kinto.dev.mozaws.net/v1/\"\n+        (Kinto.Basic \"test\" \"test\")\n+\n+\n+\n+-- Set up the resource we're interested in: in this case, Kinto records, stored\n+-- in the \"test-items\" collection, in the \"default\" bucket.\n+-- We give it the `decodeTodo` decoder so the data we get back from the Kinto\n+-- server will be properly decoded into our `Todo` record.\n+\n+\n+recordResource : Kinto.Resource Todo\n+recordResource =\n+    Kinto.recordResource \"default\" \"test-items\" decodeTodo\n+\n+\n+\n+-- Add a new Todo\n+\n+\n+addTodo : Maybe String -> Maybe String -> Cmd Msg\n+addTodo title description =","path":"examples/Example.elm","position":74,"original_position":74,"commit_id":"bd01c30cb199f6e983023eafa341ad1b57c9f589","original_commit_id":"bd01c30cb199f6e983023eafa341ad1b57c9f589","user":{"login":"magopian","id":167767,"avatar_url":"https://avatars.githubusercontent.com/u/167767?v=3","gravatar_id":"","url":"https://api.github.com/users/magopian","html_url":"https://github.com/magopian","followers_url":"https://api.github.com/users/magopian/followers","following_url":"https://api.github.com/users/magopian/following{/other_user}","gists_url":"https://api.github.com/users/magopian/gists{/gist_id}","starred_url":"https://api.github.com/users/magopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magopian/subscriptions","organizations_url":"https://api.github.com/users/magopian/orgs","repos_url":"https://api.github.com/users/magopian/repos","events_url":"https://api.github.com/users/magopian/events{/privacy}","received_events_url":"https://api.github.com/users/magopian/received_events","type":"User","site_admin":false},"body":"I agree with both those comments, but I'd rather not implement them here: It's an example file that is used as the \"base\" for the example in the README, and I'd like it to be as minimal as possible.\r\n\r\nOn that note, I'm not entirely happy with the way it is at the moment: I have no way to make sure that the Example.elm file compiles properly (i'll try to add an entry in travis or something), and even if it does, I need to remember to mirror all the changes in it that are also in the README in both the files...","created_at":"2016-12-02T11:43:24Z","updated_at":"2016-12-02T11:43:24Z","html_url":"https://github.com/Kinto/kinto-elm-experiments/pull/16#discussion_r90628729","pull_request_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments/90628729"},"html":{"href":"https://github.com/Kinto/kinto-elm-experiments/pull/16#discussion_r90628729"},"pull_request":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16","id":95664979,"html_url":"https://github.com/Kinto/kinto-elm-experiments/pull/16","diff_url":"https://github.com/Kinto/kinto-elm-experiments/pull/16.diff","patch_url":"https://github.com/Kinto/kinto-elm-experiments/pull/16.patch","issue_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/16","number":16,"state":"open","locked":false,"title":"[WIP] Prepare Kinto.elm to be released as a standalone package","user":{"login":"magopian","id":167767,"avatar_url":"https://avatars.githubusercontent.com/u/167767?v=3","gravatar_id":"","url":"https://api.github.com/users/magopian","html_url":"https://github.com/magopian","followers_url":"https://api.github.com/users/magopian/followers","following_url":"https://api.github.com/users/magopian/following{/other_user}","gists_url":"https://api.github.com/users/magopian/gists{/gist_id}","starred_url":"https://api.github.com/users/magopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magopian/subscriptions","organizations_url":"https://api.github.com/users/magopian/orgs","repos_url":"https://api.github.com/users/magopian/repos","events_url":"https://api.github.com/users/magopian/events{/privacy}","received_events_url":"https://api.github.com/users/magopian/received_events","type":"User","site_admin":false},"body":"- [ ] [Write helpful documentation with examples](http://package.elm-lang.org/help/design-guidelines#write-helpful-documentation-with-examples)\r\n- [ ] [Design for a concrete use case](http://package.elm-lang.org/help/design-guidelines#design-for-a-concrete-use-case)\r\n- [x] [The data structure is always the last argument](http://package.elm-lang.org/help/design-guidelines#the-data-structure-is-always-the-last-argument)\r\n- [x] [Keep tags and record constructors secret](http://package.elm-lang.org/help/design-guidelines#write-helpful-documentation-with-examples)\r\n- [x] [Make sure the naming is good](http://package.elm-lang.org/help/design-guidelines#naming)","created_at":"2016-11-29T10:33:01Z","updated_at":"2016-12-02T11:43:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5507c7b60ac2780d1aadd5d228a210973bb8210d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16/commits","review_comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16/comments","review_comment_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/16/comments","statuses_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/bd01c30cb199f6e983023eafa341ad1b57c9f589","head":{"label":"Kinto:prepare-package","ref":"prepare-package","sha":"bd01c30cb199f6e983023eafa341ad1b57c9f589","user":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"repo":{"id":68020486,"name":"kinto-elm-experiments","full_name":"Kinto/kinto-elm-experiments","owner":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kinto/kinto-elm-experiments","description":"Experimenting with Elm and the Kinto API","fork":false,"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments","forks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/forks","keys_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/teams","hooks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/hooks","issue_events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/events{/number}","events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/events","assignees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/assignees{/user}","branches_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/branches{/branch}","tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/tags","blobs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/{sha}","languages_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/languages","stargazers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/stargazers","contributors_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contributors","subscribers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscribers","subscription_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscription","commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contents/{+path}","compare_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/merges","archive_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/downloads","issues_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues{/number}","pulls_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls{/number}","milestones_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/milestones{/number}","notifications_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/labels{/name}","releases_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/releases{/id}","deployments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/deployments","created_at":"2016-09-12T15:13:15Z","updated_at":"2016-12-01T08:04:02Z","pushed_at":"2016-12-01T14:03:59Z","git_url":"git://github.com/Kinto/kinto-elm-experiments.git","ssh_url":"git@github.com:Kinto/kinto-elm-experiments.git","clone_url":"https://github.com/Kinto/kinto-elm-experiments.git","svn_url":"https://github.com/Kinto/kinto-elm-experiments","homepage":"https://Kinto.github.io/kinto-elm-experiments/","size":219,"stargazers_count":2,"watchers_count":2,"language":"Elm","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"Kinto:master","ref":"master","sha":"a2dcb469187cb53063509a7760b82b75eb544e7f","user":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"repo":{"id":68020486,"name":"kinto-elm-experiments","full_name":"Kinto/kinto-elm-experiments","owner":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kinto/kinto-elm-experiments","description":"Experimenting with Elm and the Kinto API","fork":false,"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments","forks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/forks","keys_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/teams","hooks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/hooks","issue_events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/events{/number}","events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/events","assignees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/assignees{/user}","branches_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/branches{/branch}","tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/tags","blobs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/{sha}","languages_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/languages","stargazers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/stargazers","contributors_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contributors","subscribers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscribers","subscription_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscription","commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contents/{+path}","compare_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/merges","archive_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/downloads","issues_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues{/number}","pulls_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls{/number}","milestones_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/milestones{/number}","notifications_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/labels{/name}","releases_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/releases{/id}","deployments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/deployments","created_at":"2016-09-12T15:13:15Z","updated_at":"2016-12-01T08:04:02Z","pushed_at":"2016-12-01T14:03:59Z","git_url":"git://github.com/Kinto/kinto-elm-experiments.git","ssh_url":"git@github.com:Kinto/kinto-elm-experiments.git","clone_url":"https://github.com/Kinto/kinto-elm-experiments.git","svn_url":"https://github.com/Kinto/kinto-elm-experiments","homepage":"https://Kinto.github.io/kinto-elm-experiments/","size":219,"stargazers_count":2,"watchers_count":2,"language":"Elm","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16"},"html":{"href":"https://github.com/Kinto/kinto-elm-experiments/pull/16"},"issue":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/16"},"comments":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/bd01c30cb199f6e983023eafa341ad1b57c9f589"}}}}
{"actor":{"display_login":"magopian"}}