Skip to content

Selectors inside a resolver, as args alone might not be enough to key #3

@tim-field

Description

@tim-field

Hey I've posted two dumb issues today, lets go for three. ;)

Is this on the right track?

const entitiesSortedSelector = createCachedSelector(
  entitiesPathSelector,
  sortBySelector,
  sortOrderSelector,
  (entities, sortBy, sortOrder) =>  
     orderBy(entities.toList().toJS(), getSortIteratee(sortBy), sortOrder);
)((state, { path, sortBy, sortOrder }) => {
  const entities = entitiesPathSelector(state, { path }); 
  return `${entities.hashCode()}:${sortBy}:${sortOrder}`;
});

I initially hoped that the resolver function would recieve the same args as the resolved function ( issue #2), if it doesn't then I really want to check that I'm dealing with the same entities collection here ( path param alone isn't enough )

Is the code above a correct path to take ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions