UNPKG

stream-chat-react-native-core

Version:

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

23 lines 1.04 kB
Object.defineProperty(exports, "__esModule", { value: true }); exports.useSystemNotifications = void 0; var _react = require("react"); var _useNotificationApi = require("./useNotificationApi"); var _ChatContext = require("../../../contexts/chatContext/ChatContext"); var _useStateStore2 = require("../../../hooks/useStateStore"); var useSystemNotifications = options => { var _useChatContext = (0, _ChatContext.useChatContext)(), client = _useChatContext.client; var selector = (0, _react.useCallback)(state => { var withSystemTag = state.notifications.filter(_useNotificationApi.hasSystemNotificationTag); return { notifications: options?.filter ? withSystemTag.filter(options.filter) : withSystemTag }; }, [options?.filter]); var _useStateStore = (0, _useStateStore2.useStateStore)(client.notifications.store, selector), notifications = _useStateStore.notifications; return notifications; }; exports.useSystemNotifications = useSystemNotifications; //# sourceMappingURL=useSystemNotifications.js.map