You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
568 B
16 lines
568 B
import type { Map as ImmutableMap, List as ImmutableList } from 'immutable'; |
|
|
|
import type { List } from 'mastodon/models/list'; |
|
import { createAppSelector } from 'mastodon/store'; |
|
|
|
const getLists = createAppSelector( |
|
[(state) => state.lists], |
|
(lists: ImmutableMap<string, List | null>): ImmutableList<List> => |
|
lists.toList().filter((item: List | null): item is List => !!item), |
|
); |
|
|
|
export const getOrderedLists = createAppSelector( |
|
[(state) => getLists(state)], |
|
(lists) => |
|
lists.sort((a: List, b: List) => a.title.localeCompare(b.title)).toArray(), |
|
);
|
|
|