Skip to content

Instantly share code, notes, and snippets.

@kitze
Created January 11, 2016 22:32
Show Gist options
  • Save kitze/7398121a6d4995b9de71 to your computer and use it in GitHub Desktop.
Save kitze/7398121a6d4995b9de71 to your computer and use it in GitHub Desktop.
Shortest version of onnecting a container to a store (without a decorator on the class) with ES6, ES7 and lodash.pick
export default connect(
({storage, addStorageForm}) => ({
...pick(storage, ['storages', 'loading']),
...pick(addStorageForm, ['editingStorageItem']),
}),
dispatch => ({
actions: bindActionCreators({...storageActions, ...addStorageFormActions}, dispatch)
})
)(Container);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment