{"action":"created","issue":{"url":"https://api.github.com/repos/yoshuawuyts/choo/issues/23","repository_url":"https://api.github.com/repos/yoshuawuyts/choo","labels_url":"https://api.github.com/repos/yoshuawuyts/choo/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/yoshuawuyts/choo/issues/23/comments","events_url":"https://api.github.com/repos/yoshuawuyts/choo/issues/23/events","html_url":"https://github.com/yoshuawuyts/choo/issues/23","id":157185574,"number":23,"title":"State should be able to be an array","user":{"login":"timwis","id":761444,"avatar_url":"https://avatars.githubusercontent.com/u/761444?v=3","gravatar_id":"","url":"https://api.github.com/users/timwis","html_url":"https://github.com/timwis","followers_url":"https://api.github.com/users/timwis/followers","following_url":"https://api.github.com/users/timwis/following{/other_user}","gists_url":"https://api.github.com/users/timwis/gists{/gist_id}","starred_url":"https://api.github.com/users/timwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timwis/subscriptions","organizations_url":"https://api.github.com/users/timwis/orgs","repos_url":"https://api.github.com/users/timwis/repos","events_url":"https://api.github.com/users/timwis/events{/privacy}","received_events_url":"https://api.github.com/users/timwis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-27T11:21:20Z","updated_at":"2016-05-27T14:01:38Z","closed_at":null,"body":"I have a \"tables\" model that's a collection of tables. I would expect to be able to set my `state` property to an array within the `tables` `namespace` and the resulting global state look like: `{ app: {}, tables: [] }` as it would in redux. Instead, if you set the `state` to an empty array, it's not included in the global state. If you set it to an array with a value, it gets set to `{tables: {0: 'that value'}}`.\r\n\r\nNot a big deal, just thought I'd point it out. At first glance I imagine it could be an issue with `apply` or `xtend`."},"comment":{"url":"https://api.github.com/repos/yoshuawuyts/choo/issues/comments/222154120","html_url":"https://github.com/yoshuawuyts/choo/issues/23#issuecomment-222154120","issue_url":"https://api.github.com/repos/yoshuawuyts/choo/issues/23","id":222154120,"user":{"login":"yoshuawuyts","id":2467194,"avatar_url":"https://avatars.githubusercontent.com/u/2467194?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshuawuyts","html_url":"https://github.com/yoshuawuyts","followers_url":"https://api.github.com/users/yoshuawuyts/followers","following_url":"https://api.github.com/users/yoshuawuyts/following{/other_user}","gists_url":"https://api.github.com/users/yoshuawuyts/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshuawuyts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshuawuyts/subscriptions","organizations_url":"https://api.github.com/users/yoshuawuyts/orgs","repos_url":"https://api.github.com/users/yoshuawuyts/repos","events_url":"https://api.github.com/users/yoshuawuyts/events{/privacy}","received_events_url":"https://api.github.com/users/yoshuawuyts/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T14:01:38Z","updated_at":"2016-05-27T14:01:38Z","body":"Hmm, I think this ties further into whether or not non-objects should be supported at the top level. If you're not using namespaces it should diff just fine. We could probably detect if an obj\r\n\r\nJust to verify, what you're trying to achieve is:\r\n```js\r\napp.model({\r\n  namespace: 'tables',\r\n  model: [],\r\n  reducers: { /* things go here */}\r\n})\r\n```\r\n\r\nGiven the approach I'm proposing, this should be possible too:\r\n```js\r\napp.model({\r\n  namespace: 'something',\r\n  model: 'foobar',\r\n  reducers: {\r\n    update: (state, action) => state + 'bar'  // 'foobarbar'\r\n  }\r\n})\r\n```"}}
{"actor":{"display_login":"yoshuawuyts"}}