Changeset View
Changeset View
Standalone View
Standalone View
web/selectors/thread-selectors.js
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | ) => ?$ReadOnlySet<string> = createSelector( | ||||
): ?$ReadOnlySet<string> => { | ): ?$ReadOnlySet<string> => { | ||||
if (!communityIDFilter) { | if (!communityIDFilter) { | ||||
return null; | return null; | ||||
} | } | ||||
return filteredCommunityThreadIDs(communityIDFilter, threadInfos); | return filteredCommunityThreadIDs(communityIDFilter, threadInfos); | ||||
}, | }, | ||||
); | ); | ||||
function useCommunityIsPicked(communityID: string): boolean { | |||||
const communityIDFilter = useSelector(state => state.communityIDFilter); | |||||
return communityID === communityIDFilter; | |||||
} | |||||
export { | export { | ||||
useOnClickThread, | useOnClickThread, | ||||
useThreadIsActive, | useThreadIsActive, | ||||
useOnClickPendingSidebar, | useOnClickPendingSidebar, | ||||
useOnClickNewThread, | useOnClickNewThread, | ||||
filteredCommunityThreadIDsSelector, | filteredCommunityThreadIDsSelector, | ||||
filteredCommunityThreadIDs, | filteredCommunityThreadIDs, | ||||
useCommunityIsPicked, | |||||
}; | }; |