Resourceful.Collection.Sort (Resourceful v0.1.6)
View SourceProvides a common interface for sorting collections. See call/2 for use and
examples.
This module is intended to dispatch arguments to the appropriate Sort module
for the underlying data source.
Summary
Functions
Returns a data source that is sorted in accordance with sorters.
Types
@type t() :: {:asc | :desc, Resourceful.Collection.queryable()}
Functions
Returns a data source that is sorted in accordance with sorters.
If data_source is not an actual list of resources (e.g. an Ecto Queryable)
underlying modules should not return a list of resources, but rather a sorted
version of data_source.
Args
data_source: SeeResourceful.Collectionmodule overview.sorters: A list or comma separated string of sort parameters. Sort parameters should be the string name of a field preceded by, optionally, a+for ascending order (the default) or a-for descending order or. Examples ofsorters:"name,-age"["+name", "-age"]