You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importcreateCachedSelectorfrom're-reselect';import{createSelector}from'reselect';import{orderBy}from'lodash/collection';constentitiesSelector=createSelector(selectGlobal,(state)=>state.get('entities'));constpathArgSelector=(state,{ path })=>path;constentitiesPathSelector=createSelector(entitiesSelector,pathArgSelector,(entities,path)=>entities.get(path));constsortBySelector=(state,{ sortBy })=>sortBy;constsortOrderSelector=(state,{ sortOrder })=>sortOrder;constentitiesSortedSelector=createCachedSelector(entitiesPathSelector,sortBySelector,sortOrderSelector,(entities,sortBy,sortOrder)=>{constcacheKey=`${entities.hashCode()}:${sortBy}:${sortOrder}`;console.log('resolver',cacheKey);// resolver -181045611:id:descconsole.log('no cache for ',sortBy,sortOrder);// no cache for id descreturnorderBy(entities.toList().toJS(),getSortIteratee(sortBy),sortOrder);})((entities,{ sortBy, sortOrder })=>{// NOTE here I'm actually getting passed my original state object! constcacheKey=`${entities.hashCode()}:${sortBy}:${sortOrder}`;console.log('cached selector',cacheKey);// cached selector 403733751:id:descreturncacheKey;})
Called like so in container.
The text was updated successfully, but these errors were encountered: