UNPKG

stream-chat-react-native-core

Version:

The official React Native and Expo components for Stream Chat, a service for building chat applications

56 lines 1.61 kB
Object.defineProperty(exports, "__esModule", { value: true }); exports.useCreateChannelsContext = void 0; var _react = require("react"); var useCreateChannelsContext = ({ additionalFlatListProps, channelListInitialized, channels, error, forceUpdate, hasNextPage, loadingChannels, loadingNextPage, loadMoreThreshold, loadNextPage, maxUnreadCount, numberOfSkeletons, onSelect, getChannelActionItems, swipeActionsEnabled, refreshing, refreshList, reloadList, setFlatListRef, mutedStatusPosition, pinnedStatusPosition }) => { var channelValueString = channels?.map(channel => `${channel.data?.name ?? ''}${channel.id ?? ''}${channel?.state?.unreadCount ?? ''}${Object.values(channel.state.members).map(member => member.user?.online).join()}`).join(); var channelsContext = (0, _react.useMemo)(() => ({ additionalFlatListProps, channelListInitialized, channels, error, forceUpdate, hasNextPage, loadingChannels, loadingNextPage, loadMoreThreshold, loadNextPage, maxUnreadCount, numberOfSkeletons, onSelect, getChannelActionItems, swipeActionsEnabled, refreshing, refreshList, reloadList, setFlatListRef, mutedStatusPosition, pinnedStatusPosition }), [channelValueString, error, forceUpdate, hasNextPage, loadingChannels, loadingNextPage, channelListInitialized, swipeActionsEnabled, refreshing, mutedStatusPosition, pinnedStatusPosition]); return channelsContext; }; exports.useCreateChannelsContext = useCreateChannelsContext; //# sourceMappingURL=useCreateChannelsContext.js.map