{"action":"created","issue":{"url":"https://api.github.com/repos/substance/substance/issues/127","labels_url":"https://api.github.com/repos/substance/substance/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/substance/substance/issues/127/comments","events_url":"https://api.github.com/repos/substance/substance/issues/127/events","html_url":"https://github.com/substance/substance/issues/127","id":110501522,"number":127,"title":"Use a simplified surface transaction API","user":{"login":"michael","id":2931,"avatar_url":"https://avatars.githubusercontent.com/u/2931?v=3","gravatar_id":"","url":"https://api.github.com/users/michael","html_url":"https://github.com/michael","followers_url":"https://api.github.com/users/michael/followers","following_url":"https://api.github.com/users/michael/following{/other_user}","gists_url":"https://api.github.com/users/michael/gists{/gist_id}","starred_url":"https://api.github.com/users/michael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael/subscriptions","organizations_url":"https://api.github.com/users/michael/orgs","repos_url":"https://api.github.com/users/michael/repos","events_url":"https://api.github.com/users/michael/events{/privacy}","received_events_url":"https://api.github.com/users/michael/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"oliver----","id":284099,"avatar_url":"https://avatars.githubusercontent.com/u/284099?v=3","gravatar_id":"","url":"https://api.github.com/users/oliver----","html_url":"https://github.com/oliver----","followers_url":"https://api.github.com/users/oliver----/followers","following_url":"https://api.github.com/users/oliver----/following{/other_user}","gists_url":"https://api.github.com/users/oliver----/gists{/gist_id}","starred_url":"https://api.github.com/users/oliver----/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliver----/subscriptions","organizations_url":"https://api.github.com/users/oliver----/orgs","repos_url":"https://api.github.com/users/oliver----/repos","events_url":"https://api.github.com/users/oliver----/events{/privacy}","received_events_url":"https://api.github.com/users/oliver----/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/substance/substance/milestones/3","html_url":"https://github.com/substance/substance/milestones/Beta%203","labels_url":"https://api.github.com/repos/substance/substance/milestones/3/labels","id":1323787,"number":3,"title":"Beta 3","description":"","creator":{"login":"michael","id":2931,"avatar_url":"https://avatars.githubusercontent.com/u/2931?v=3","gravatar_id":"","url":"https://api.github.com/users/michael","html_url":"https://github.com/michael","followers_url":"https://api.github.com/users/michael/followers","following_url":"https://api.github.com/users/michael/following{/other_user}","gists_url":"https://api.github.com/users/michael/gists{/gist_id}","starred_url":"https://api.github.com/users/michael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael/subscriptions","organizations_url":"https://api.github.com/users/michael/orgs","repos_url":"https://api.github.com/users/michael/repos","events_url":"https://api.github.com/users/michael/events{/privacy}","received_events_url":"https://api.github.com/users/michael/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":1,"state":"open","created_at":"2015-09-25T13:17:52Z","updated_at":"2015-11-20T14:42:02Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-10-08T17:16:45Z","updated_at":"2015-11-20T16:58:53Z","closed_at":null,"body":"Before:\r\n\r\n```js\r\nsurface.transaction({ selection: sel }, function(tx, args) {\r\n  args.annotationType = self.getAnnotationType();\r\n  args.annotationData = self.getAnnotationData();\r\n  args.splitContainerSelections = false;\r\n  args.containerId = self.getContainerId();\r\n\r\n  args = transformFn(tx, args);\r\n  result = args.result;\r\n  return args;\r\n});\r\n```\r\n\r\nAfter:\r\n\r\n```js\r\nsurface.transaction(sel, function(tx, sel) {\r\n  args.annotationType = self.getAnnotationType();\r\n  args.annotationData = self.getAnnotationData();\r\n  args.splitContainerSelections = false;\r\n  args.containerId = self.getContainerId();\r\n\r\n  args = transformFn(tx, args);\r\n  result = args.result;\r\n  return sel;\r\n});\r\n```\r\n\r\nWe also should improve how transformations should be parametrized (parameter list instead of object) and return values."},"comment":{"url":"https://api.github.com/repos/substance/substance/issues/comments/158459643","html_url":"https://github.com/substance/substance/issues/127#issuecomment-158459643","issue_url":"https://api.github.com/repos/substance/substance/issues/127","id":158459643,"user":{"login":"michael","id":2931,"avatar_url":"https://avatars.githubusercontent.com/u/2931?v=3","gravatar_id":"","url":"https://api.github.com/users/michael","html_url":"https://github.com/michael","followers_url":"https://api.github.com/users/michael/followers","following_url":"https://api.github.com/users/michael/following{/other_user}","gists_url":"https://api.github.com/users/michael/gists{/gist_id}","starred_url":"https://api.github.com/users/michael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael/subscriptions","organizations_url":"https://api.github.com/users/michael/orgs","repos_url":"https://api.github.com/users/michael/repos","events_url":"https://api.github.com/users/michael/events{/privacy}","received_events_url":"https://api.github.com/users/michael/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T16:58:53Z","updated_at":"2015-11-20T16:58:53Z","body":"Yes, let's shift this."}}