Eugen Rochko 5e5dbf9375 [Glitch] Refactor <FavouritedStatuses> and <BookmarkedStatuses> into TypeScript
Port 6a39f00745ab2da7917f9584f94ef1eb456001c4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2025-04-08 20:43:43 +02:00

16 lines
444 B
TypeScript

import { createSelector } from '@reduxjs/toolkit';
import type { OrderedSet as ImmutableOrderedSet } from 'immutable';
import type { RootState } from 'flavours/glitch/store';
export const getStatusList = createSelector(
[
(
state: RootState,
type: 'favourites' | 'bookmarks' | 'pins' | 'trending',
) =>
state.status_lists.getIn([type, 'items']) as ImmutableOrderedSet<string>,
],
(items) => items.toList(),
);