{"action":"created","issue":{"url":"https://api.github.com/repos/sylvainpolletvillard/ObjectModel/issues/91","repository_url":"https://api.github.com/repos/sylvainpolletvillard/ObjectModel","labels_url":"https://api.github.com/repos/sylvainpolletvillard/ObjectModel/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/sylvainpolletvillard/ObjectModel/issues/91/comments","events_url":"https://api.github.com/repos/sylvainpolletvillard/ObjectModel/issues/91/events","html_url":"https://github.com/sylvainpolletvillard/ObjectModel/issues/91","id":351309108,"node_id":"MDU6SXNzdWUzNTEzMDkxMDg=","number":91,"title":"Enumeration of read-only getters","user":{"login":"gotjoshua","id":8686454,"node_id":"MDQ6VXNlcjg2ODY0NTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/8686454?v=4","gravatar_id":"","url":"https://api.github.com/users/gotjoshua","html_url":"https://github.com/gotjoshua","followers_url":"https://api.github.com/users/gotjoshua/followers","following_url":"https://api.github.com/users/gotjoshua/following{/other_user}","gists_url":"https://api.github.com/users/gotjoshua/gists{/gist_id}","starred_url":"https://api.github.com/users/gotjoshua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gotjoshua/subscriptions","organizations_url":"https://api.github.com/users/gotjoshua/orgs","repos_url":"https://api.github.com/users/gotjoshua/repos","events_url":"https://api.github.com/users/gotjoshua/events{/privacy}","received_events_url":"https://api.github.com/users/gotjoshua/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-16T18:00:02Z","updated_at":"2018-08-17T17:54:59Z","closed_at":null,"author_association":"NONE","body":"Why are props of an ObjectModel which are only accessible via getters, \r\nnot automatically enumerable?\r\n\r\nExample 1 (I expect gettableNestedInfo to enumerate):\r\n```js\r\nlet NestedOM = ObjectModel({nestedInfo:[String]});\r\nclass Mod extends ObjectModel({\r\n  id: Number,\r\n  nested: [NestedOM],\r\n  gettableNestedInfo: [String],\r\n  info: [String]\r\n}){\r\n  get gettableNestedInfo(){\r\n    return this.nested.nestedInfo;\r\n  }\r\n}\r\n```\r\nhttps://codepen.io/gotjoshua/pen/qyzyWq\r\n\r\ni could imagine that if there was a getter but no property in the model definition, \r\nthen it would not be enumerable:\r\n```js\r\nlet NestedOM = ObjectModel({nestedInfo:[String]});\r\nclass Mod extends ObjectModel({\r\n  id: Number,\r\n  nested: [NestedOM],\r\n  // gettableNestedInfo: [String],\r\n  info: [String]\r\n}){\r\n  get gettableNestedInfo(){\r\n    return this.nested.nestedInfo;\r\n  }\r\n}\r\n```\r\n\r\nAs usual, I assume that you have put more thought into it than I, \r\nI just find it awkward to have to add all these bulky defineProperty commands:\r\n```js\r\nObject.defineProperty(Mod.prototype, 'gettableNestedInfo', {\r\n  enumerable: true,\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/sylvainpolletvillard/ObjectModel/issues/comments/413942342","html_url":"https://github.com/sylvainpolletvillard/ObjectModel/issues/91#issuecomment-413942342","issue_url":"https://api.github.com/repos/sylvainpolletvillard/ObjectModel/issues/91","id":413942342,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzk0MjM0Mg==","user":{"login":"sylvainpolletvillard","id":566536,"node_id":"MDQ6VXNlcjU2NjUzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/566536?v=4","gravatar_id":"","url":"https://api.github.com/users/sylvainpolletvillard","html_url":"https://github.com/sylvainpolletvillard","followers_url":"https://api.github.com/users/sylvainpolletvillard/followers","following_url":"https://api.github.com/users/sylvainpolletvillard/following{/other_user}","gists_url":"https://api.github.com/users/sylvainpolletvillard/gists{/gist_id}","starred_url":"https://api.github.com/users/sylvainpolletvillard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sylvainpolletvillard/subscriptions","organizations_url":"https://api.github.com/users/sylvainpolletvillard/orgs","repos_url":"https://api.github.com/users/sylvainpolletvillard/repos","events_url":"https://api.github.com/users/sylvainpolletvillard/events{/privacy}","received_events_url":"https://api.github.com/users/sylvainpolletvillard/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T17:54:59Z","updated_at":"2018-08-17T17:54:59Z","author_association":"OWNER","body":"I see. I did not find a simpler way than your current solution based on `Object.defineProperty` to set a property enumerable. I also think this is not the responsability of ObjectModel to add an API for that, as you would have the exact same problem without using the library."}}
{"actor":{"display_login":"sylvainpolletvillard"}}