Refactor <FavouritedStatuses> and <BookmarkedStatuses> into TypeScript (#34356)

This commit is contained in:
Eugen Rochko 2025-04-08 18:06:31 +02:00 committed by GitHub
parent bdf9baa2e8
commit 6a39f00745
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 249 additions and 234 deletions

View file

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