For some strange weird reason my reselect selector is returning this function :
ƒ () {
if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {
// apply arguments instead of spreading for performance.
lastResult = func.apply(null, arguments);
}
I do not understand why it is doing this. It is supposed to return some JSON which I can use to map in my mapToProps.
My redux mapping is simple enough and looks like this :
const mapStateToProps = (state) => {
return {
initialValues: selectShop(state),
}
}
My selector file looks like this :
import { createSelector } from 'reselect';
//shops selector
const selectDomain = () => state => (state ? state.shops : {});
export const selectShop = () =>
createSelector(
selectDomain(),
shops => {
let shop = shops.filter(shop => shop.selected);
return shop[0];
},
);
Why am I getting a function returned instead of JSON?