lbry-redux/src/redux/selectors/blocked.js
Sean Yesmunt cca78e9341 Revert "remove comment/blocked code"
This reverts commit e4c05cebe9.
2020-06-29 17:02:19 -04:00

22 lines
563 B
JavaScript

// @flow
import { createSelector } from 'reselect';
const selectState = (state: { blocked: BlocklistState }) => state.blocked || {};
export const selectBlockedChannels = createSelector(
selectState,
(state: BlocklistState) => state.blockedChannels
);
export const selectBlockedChannelsCount = createSelector(
selectBlockedChannels,
(state: Array<string>) => state.length
);
export const selectChannelIsBlocked = (uri: string) =>
createSelector(
selectBlockedChannels,
(state: Array<string>) => {
return state.includes(uri);
}
);