Changeset View
Changeset View
Standalone View
Standalone View
web/selectors/calendar-selectors.js
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | ) => ?$ReadOnlySet<string> = createSelector( | ||||
(communityIDFilter: ?string, threadInfos: { +[id: string]: ThreadInfo }) => { | (communityIDFilter: ?string, threadInfos: { +[id: string]: ThreadInfo }) => { | ||||
if (!communityIDFilter) { | if (!communityIDFilter) { | ||||
return null; | return null; | ||||
} | } | ||||
return filterThreadIDsBelongingToCommunity(communityIDFilter, threadInfos); | return filterThreadIDsBelongingToCommunity(communityIDFilter, threadInfos); | ||||
}, | }, | ||||
); | ); | ||||
function useCommunityIsPicked(communityID: string): boolean { | |||||
const communityIDFilter = useSelector(state => state.communityIDFilter); | |||||
return communityID === communityIDFilter; | |||||
} | |||||
export { | export { | ||||
useFilterThreadInfos, | useFilterThreadInfos, | ||||
useFilterThreadSearchIndex, | useFilterThreadSearchIndex, | ||||
filterThreadIDsBelongingToCommunitySelector, | filterThreadIDsBelongingToCommunitySelector, | ||||
filterThreadIDsBelongingToCommunity, | filterThreadIDsBelongingToCommunity, | ||||
useCommunityIsPicked, | |||||
}; | }; |