import { D } from '@mobily/ts-belt'; export function buildSelectors(localSelectors = {}, subduxes = {}) { const subSelectors = (Object.entries(subduxes) as any).map( ([slice, { selectors }]) => D.map(selectors, (subSelect) => (state) => subSelect(state[slice])), ); return [localSelectors, ...subSelectors].reduce(D.merge); }