Skip to content

Question: how to sort on both asc / desc #9

@mesqueeb

Description

@mesqueeb

Dear creator:

I'd want to use your plugin like so:

    var result = arraySort(posts,
                             ['locals.foo', 'locals.date'], 
                             [{reverse: true}, {reverse: false}]
                          );

I'm sure this can be done with custom sorting, but it would be great if you could make this syntax work.

Or even better syntax imo:

    var result = arraySort(posts, [
        {field: 'locals.foo', direction: 'desc'},
        {field: 'locals.date', direction: 'asc'},
    ]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions