Skip to content

orderBy issue #485

Open
Open

Description

I just had a question about the use of Redux-ORM's orderBy function. So I have a selector like this:

export const select = createSelector(
  orm.Entity.orderBy("id", "desc")
);

However, when I try to use it in my mapStateToProps I get an error message:

orderBy is not a function

How is orderBy properly used when selecting an array of an entity type?

Activity

  1. Shrugsy commented on Jul 27, 2020

    @Shrugsy

    Try the following using a 'Custom result function':

    export const select = createSelector(orm, session => session.Entity.all().orderBy("id", "desc"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions