{"action":"created","issue":{"url":"https://api.github.com/repos/Kinto/kinto.js/issues/302","repository_url":"https://api.github.com/repos/Kinto/kinto.js","labels_url":"https://api.github.com/repos/Kinto/kinto.js/issues/302/labels{/name}","comments_url":"https://api.github.com/repos/Kinto/kinto.js/issues/302/comments","events_url":"https://api.github.com/repos/Kinto/kinto.js/issues/302/events","html_url":"https://github.com/Kinto/kinto.js/pull/302","id":127658646,"number":302,"title":"Add collection transformers.","user":{"login":"almet","id":67073,"avatar_url":"https://avatars.githubusercontent.com/u/67073?v=3","gravatar_id":"","url":"https://api.github.com/users/almet","html_url":"https://github.com/almet","followers_url":"https://api.github.com/users/almet/followers","following_url":"https://api.github.com/users/almet/following{/other_user}","gists_url":"https://api.github.com/users/almet/gists{/gist_id}","starred_url":"https://api.github.com/users/almet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almet/subscriptions","organizations_url":"https://api.github.com/users/almet/orgs","repos_url":"https://api.github.com/users/almet/repos","events_url":"https://api.github.com/users/almet/events{/privacy}","received_events_url":"https://api.github.com/users/almet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Kinto/kinto.js/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/Kinto/kinto.js/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/Kinto/kinto.js/labels/ready","name":"ready","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Kinto/kinto.js/milestones/2","html_url":"https://github.com/Kinto/kinto.js/milestones/2.0.0","labels_url":"https://api.github.com/repos/Kinto/kinto.js/milestones/2/labels","id":1293356,"number":2,"title":"2.0.0","description":"","creator":{"login":"n1k0","id":41547,"avatar_url":"https://avatars.githubusercontent.com/u/41547?v=3","gravatar_id":"","url":"https://api.github.com/users/n1k0","html_url":"https://github.com/n1k0","followers_url":"https://api.github.com/users/n1k0/followers","following_url":"https://api.github.com/users/n1k0/following{/other_user}","gists_url":"https://api.github.com/users/n1k0/gists{/gist_id}","starred_url":"https://api.github.com/users/n1k0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n1k0/subscriptions","organizations_url":"https://api.github.com/users/n1k0/orgs","repos_url":"https://api.github.com/users/n1k0/repos","events_url":"https://api.github.com/users/n1k0/events{/privacy}","received_events_url":"https://api.github.com/users/n1k0/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":17,"state":"open","created_at":"2015-09-07T09:04:43Z","updated_at":"2016-02-09T09:53:18Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-01-20T11:04:33Z","updated_at":"2016-02-23T12:02:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Kinto/kinto.js/pulls/302","html_url":"https://github.com/Kinto/kinto.js/pull/302","diff_url":"https://github.com/Kinto/kinto.js/pull/302.diff","patch_url":"https://github.com/Kinto/kinto.js/pull/302.patch"},"body":"This adds the concept of collection transformers.\r\n\r\nI haven't updated the documentation because I'm not sure about the concepts we want to expose, as mentioned in #154 & #153.\r\n\r\nThe documentation states that transformers should be able to encode and decode, but I'm not sure that should be the case for what's implemented here as \"collection transformers\". I'm happy to have any feedback on the naming (and of course the implementation).\r\n\r\nIf we chose to go with the \"transformers\" approach (and still not have decode / encode), then the documentation will need to be updated to explain what a collection should be.\r\n\r\nFor what it's worth, the first version of this code was implemented with \"decode\" and \"encode\" functions, but I couldn't see why we were needing them, so I removed them and passed a function instead.\r\n\r\nI'm very interested by any feedback on this, so if anyone has time, don't hesitate :) cc @n1k0  @michielbdejong "},"comment":{"url":"https://api.github.com/repos/Kinto/kinto.js/issues/comments/187672698","html_url":"https://github.com/Kinto/kinto.js/pull/302#issuecomment-187672698","issue_url":"https://api.github.com/repos/Kinto/kinto.js/issues/302","id":187672698,"user":{"login":"almet","id":67073,"avatar_url":"https://avatars.githubusercontent.com/u/67073?v=3","gravatar_id":"","url":"https://api.github.com/users/almet","html_url":"https://github.com/almet","followers_url":"https://api.github.com/users/almet/followers","following_url":"https://api.github.com/users/almet/following{/other_user}","gists_url":"https://api.github.com/users/almet/gists{/gist_id}","starred_url":"https://api.github.com/users/almet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almet/subscriptions","organizations_url":"https://api.github.com/users/almet/orgs","repos_url":"https://api.github.com/users/almet/repos","events_url":"https://api.github.com/users/almet/events{/privacy}","received_events_url":"https://api.github.com/users/almet/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T12:02:33Z","updated_at":"2016-02-23T12:02:33Z","body":"I've updated the pull request:\r\n- [x] addressed your nits;\r\n- [x] added new tests ensuring that the hooks are chainable;\r\n- [x] added new tests ensuring that the return value of the hooks is used;\r\n- [x] pass the current collection as the second argument of the hooks + tests.\r\n\r\nLet me know if there is anything else needed in order to land this."}}