UNPKG

stream-chat-react-native-core

Version:

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

29 lines 1.19 kB
Object.defineProperty(exports, "__esModule", { value: true }); exports.useInAppNotificationsState = void 0; var _useStableCallback = require("./useStableCallback"); var _useStateStore2 = require("./useStateStore"); var _inAppNotificationsStore = require("../state-store/in-app-notifications-store"); var selector = ({ notifications }) => ({ notifications }); var useInAppNotificationsState = () => { var _useStateStore = (0, _useStateStore2.useStateStore)(_inAppNotificationsStore.inAppNotificationsStore, selector), notifications = _useStateStore.notifications; var openInAppNotificationInternal = (0, _useStableCallback.useStableCallback)(notificationData => { (0, _inAppNotificationsStore.openInAppNotification)(notificationData); }); var closeInAppNotificationInternal = (0, _useStableCallback.useStableCallback)(id => { (0, _inAppNotificationsStore.closeInAppNotification)(id); }); return { closeInAppNotification: closeInAppNotificationInternal, notifications, openInAppNotification: openInAppNotificationInternal }; }; exports.useInAppNotificationsState = useInAppNotificationsState; //# sourceMappingURL=useInAppNotificationsState.js.map