I've got an redux state like this :
const state = fromJS({
books: {
"book1": {
"name": "name1"
},
"book2": {
"name": "name2"
},
"book3": {
"name": "name2"
}
}
});
I'm trying to create an selector that would give me a collection of books in form of JS object.
export const booksSelector = state => state.get('books');
I'm using this selector as :
const mapStateToProps = state => ({
books: booksSelector(state),
});
But it returns Map - I've already checked docs and other placed and I shouldn't be doing any toJS() here. Is there any way to create a proper selector that would actually convert that map to an object? I've got lots of components that would use booksSelector and it seems like I might have to append books.toJS() in each of them which is kinda weird. Reselect library didn't help a lot.