{"action":"created","issue":{"url":"https://api.github.com/repos/glenjamin/transit-immutable-js/issues/40","repository_url":"https://api.github.com/repos/glenjamin/transit-immutable-js","labels_url":"https://api.github.com/repos/glenjamin/transit-immutable-js/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/glenjamin/transit-immutable-js/issues/40/comments","events_url":"https://api.github.com/repos/glenjamin/transit-immutable-js/issues/40/events","html_url":"https://github.com/glenjamin/transit-immutable-js/issues/40","id":250689078,"number":40,"title":"Initialisation of Record Map","user":{"login":"irisSchaffer","id":4313088,"avatar_url":"https://avatars2.githubusercontent.com/u/4313088?v=4","gravatar_id":"","url":"https://api.github.com/users/irisSchaffer","html_url":"https://github.com/irisSchaffer","followers_url":"https://api.github.com/users/irisSchaffer/followers","following_url":"https://api.github.com/users/irisSchaffer/following{/other_user}","gists_url":"https://api.github.com/users/irisSchaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/irisSchaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irisSchaffer/subscriptions","organizations_url":"https://api.github.com/users/irisSchaffer/orgs","repos_url":"https://api.github.com/users/irisSchaffer/repos","events_url":"https://api.github.com/users/irisSchaffer/events{/privacy}","received_events_url":"https://api.github.com/users/irisSchaffer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-16T16:38:33Z","updated_at":"2017-08-16T16:52:30Z","closed_at":null,"body":"Hey there!\r\n\r\nGreat library, I just have one little problem/question about this line of code: see https://github.com/glenjamin/transit-immutable-js/blob/master/index.js#L215\r\nIs there a reason for initialising the Records there? Or rather: is there a reason for initialising them with an empty Object (`{}`)?\r\n\r\nIn my case, I have Records with a constructor and because of the initialisation of the Record with `{}`, I can't use default parameters (`{ meta : {} }`) and need to check if my nested object structures exist everywhere (`data.meta && data.meta.title || ...`):\r\n\r\n```js\r\nexport default class StartPage extends StartPageRecord {\r\n  constructor(data = { meta : {} }, name) { // this here won't work\r\n    super({\r\n      ...data,\r\n      selected : new Set(data.selected),\r\n      image    : new Image(data.image),\r\n      meta     : new Meta({\r\n        title       : data.meta.title || data.title, // these throw errors\r\n        description : data.meta.description || data.subtitle // because data.meta is undefined\r\n      }),\r\n      socialLinks : new SocialLinks(data.socialLinks)\r\n    }, name)\r\n  }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/glenjamin/transit-immutable-js/issues/comments/322833368","html_url":"https://github.com/glenjamin/transit-immutable-js/issues/40#issuecomment-322833368","issue_url":"https://api.github.com/repos/glenjamin/transit-immutable-js/issues/40","id":322833368,"user":{"login":"irisSchaffer","id":4313088,"avatar_url":"https://avatars2.githubusercontent.com/u/4313088?v=4","gravatar_id":"","url":"https://api.github.com/users/irisSchaffer","html_url":"https://github.com/irisSchaffer","followers_url":"https://api.github.com/users/irisSchaffer/followers","following_url":"https://api.github.com/users/irisSchaffer/following{/other_user}","gists_url":"https://api.github.com/users/irisSchaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/irisSchaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irisSchaffer/subscriptions","organizations_url":"https://api.github.com/users/irisSchaffer/orgs","repos_url":"https://api.github.com/users/irisSchaffer/repos","events_url":"https://api.github.com/users/irisSchaffer/events{/privacy}","received_events_url":"https://api.github.com/users/irisSchaffer/received_events","type":"User","site_admin":false},"created_at":"2017-08-16T16:52:30Z","updated_at":"2017-08-16T16:52:30Z","body":"If anybody else has this problem, I have created a fork in which the records get initialised with `()` instead: https://github.com/irisSchaffer/transit-immutable-js"}}
{"actor":{"display_login":"irisSchaffer"}}