{"action":"closed","issue":{"url":"https://api.github.com/repos/acdlite/redux-actions/issues/178","repository_url":"https://api.github.com/repos/acdlite/redux-actions","labels_url":"https://api.github.com/repos/acdlite/redux-actions/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/acdlite/redux-actions/issues/178/comments","events_url":"https://api.github.com/repos/acdlite/redux-actions/issues/178/events","html_url":"https://github.com/acdlite/redux-actions/issues/178","id":197101902,"number":178,"title":"Merging defaultState with state","user":{"login":"vansosnin","id":8207551,"avatar_url":"https://avatars.githubusercontent.com/u/8207551?v=3","gravatar_id":"","url":"https://api.github.com/users/vansosnin","html_url":"https://github.com/vansosnin","followers_url":"https://api.github.com/users/vansosnin/followers","following_url":"https://api.github.com/users/vansosnin/following{/other_user}","gists_url":"https://api.github.com/users/vansosnin/gists{/gist_id}","starred_url":"https://api.github.com/users/vansosnin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vansosnin/subscriptions","organizations_url":"https://api.github.com/users/vansosnin/orgs","repos_url":"https://api.github.com/users/vansosnin/repos","events_url":"https://api.github.com/users/vansosnin/events{/privacy}","received_events_url":"https://api.github.com/users/vansosnin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-12-22T06:10:23Z","updated_at":"2017-02-08T17:18:34Z","closed_at":"2017-02-08T17:18:34Z","body":"I have a proposal to merge defaultState with state. Something like:\r\n\r\n```javascript\r\n{\r\n   ...defaultState,\r\n   ...state\r\n}\r\n```\r\n\r\nFor example, we have some _non-empty_ state and we want to add some fields which are not exist yet. Something like:\r\n\r\n```javascript\r\nconst defaultState = {\r\n    isCollapsed: true\r\n};\r\n\r\nexport default handleActions({\r\n    [types.TOGGLE_COLLAPSE]: state => ({\r\n        ...state,\r\n        isCollapsed: !state.isCollapsed\r\n    })\r\n}, defaultState);\r\n```\r\n\r\nIt seems like the `defaultState` should be merged with our state. But now it is just being ignored because state is not empty."}}
{"actor":{"display_login":"vansosnin"}}