Pure data helpers for MishkaGervaz.Table.Web.DataLoader.
Extracted from the __using__ macro so the same primitives are
reusable in user overrides and directly testable.
Summary
Functions
The empty starting state for one of the two archive-status modes
(:active or :archived). Used by apply_archive_status/3 to
swap state when toggling between modes.
Drops every entry from sorts whose field is in db_fields.
Rewrites the order of every entry in sorts whose field belongs to
db_fields, leaving the rest untouched.
Types
Functions
@spec default_mode_state() :: mode_state()
The empty starting state for one of the two archive-status modes
(:active or :archived). Used by apply_archive_status/3 to
swap state when toggling between modes.
@spec remove_sort_group([sort_entry()], [atom()]) :: [sort_entry()]
Drops every entry from sorts whose field is in db_fields.
@spec toggle_sort_group([sort_entry()], [atom()], :asc | :desc) :: [sort_entry()]
Rewrites the order of every entry in sorts whose field belongs to
db_fields, leaving the rest untouched.