Created
January 11, 2016 22:32
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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