{"action":"created","issue":{"url":"https://api.github.com/repos/cerebral/cerebral/issues/528","repository_url":"https://api.github.com/repos/cerebral/cerebral","labels_url":"https://api.github.com/repos/cerebral/cerebral/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/cerebral/cerebral/issues/528/comments","events_url":"https://api.github.com/repos/cerebral/cerebral/issues/528/events","html_url":"https://github.com/cerebral/cerebral/pull/528","id":192613567,"number":528,"title":"feat(Controller): add ability to handle binary like values","user":{"login":"christianalfoni","id":3956929,"avatar_url":"https://avatars.githubusercontent.com/u/3956929?v=3","gravatar_id":"","url":"https://api.github.com/users/christianalfoni","html_url":"https://github.com/christianalfoni","followers_url":"https://api.github.com/users/christianalfoni/followers","following_url":"https://api.github.com/users/christianalfoni/following{/other_user}","gists_url":"https://api.github.com/users/christianalfoni/gists{/gist_id}","starred_url":"https://api.github.com/users/christianalfoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianalfoni/subscriptions","organizations_url":"https://api.github.com/users/christianalfoni/orgs","repos_url":"https://api.github.com/users/christianalfoni/repos","events_url":"https://api.github.com/users/christianalfoni/events{/privacy}","received_events_url":"https://api.github.com/users/christianalfoni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-30T16:32:01Z","updated_at":"2016-11-30T17:22:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cerebral/cerebral/pulls/528","html_url":"https://github.com/cerebral/cerebral/pull/528","diff_url":"https://github.com/cerebral/cerebral/pull/528.diff","patch_url":"https://github.com/cerebral/cerebral/pull/528.patch"},"body":"Allrighty... after long and good discussions on handling binary like things (not serializable stuff) I think I found a really good solution.\r\n\r\nWe talked about identifying these on the input or use a special `.keyName` convention... but we already check the keys if they are serializable, so only thing now is to handle it differently when they are not (The payload to signal itself still has a check on being serializable though, like it needs to be a plain object):\r\n\r\n```js\r\nsomeSignal({\r\n  file: event.target.files[0]\r\n})\r\n```\r\n\r\nThere is so little code it is silly, the only thing it does when it is not serializable is that it attaches a `toJSON` method to the object :) \r\n\r\nIn actual state tree it looks like:\r\n```js\r\n{\r\n  file: FileObject\r\n}\r\n```\r\n\r\nAnd when serialized it looks like:\r\n```js\r\n{\r\n  files: '[NON_SERIALIZABLE]'\r\n}\r\n```\r\n\r\nFeel free to suggest some other naming there... but now we do not even have to mention binary. We just allow you to pass in whatever on the keys. Some is serializable some is not. We just note to people that time travel debugging does not work with \"non serializable\" state :)"},"comment":{"url":"https://api.github.com/repos/cerebral/cerebral/issues/comments/263936091","html_url":"https://github.com/cerebral/cerebral/pull/528#issuecomment-263936091","issue_url":"https://api.github.com/repos/cerebral/cerebral/issues/528","id":263936091,"user":{"login":"gaspard","id":21707,"avatar_url":"https://avatars.githubusercontent.com/u/21707?v=3","gravatar_id":"","url":"https://api.github.com/users/gaspard","html_url":"https://github.com/gaspard","followers_url":"https://api.github.com/users/gaspard/followers","following_url":"https://api.github.com/users/gaspard/following{/other_user}","gists_url":"https://api.github.com/users/gaspard/gists{/gist_id}","starred_url":"https://api.github.com/users/gaspard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaspard/subscriptions","organizations_url":"https://api.github.com/users/gaspard/orgs","repos_url":"https://api.github.com/users/gaspard/repos","events_url":"https://api.github.com/users/gaspard/events{/privacy}","received_events_url":"https://api.github.com/users/gaspard/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T17:22:01Z","updated_at":"2016-11-30T17:22:01Z","body":"For me ignoring events passed in signals is not so good. It's something annoying at first but it makes the code more readable:\r\n\r\n```js\r\n<button onClick={() => mySignal()} /> // Makes it obvious what is passed in sighal.\r\n```"}}
{"actor":{"display_login":"gaspard"}}