I am getting the following error: substate is undefined
. However, I am not sure why substate
would be undefined in my selector. Could someone please help me figure out what might be going wrong?
Selector:
import { createSelector } from 'reselect';
/**
* Direct selector to the organization state domain
*/
const selectOrganizationDomain = () => (state) => state.get('organization');
/**
* Other specific selectors
*/
/**
* Default selector used by organization
*/
const selectOrganization = () => createSelector(
selectOrganizationDomain(),
(substate) => substate.toJS()
);
const selectChanges = () => createSelector(
selectOrganization(),
(substate) => substate.get('changes')
)
export default selectOrganization;
export {
selectOrganizationDomain,
selectChanges
};