import actionCreatorFactory from 'typescript-fsa' const actionCreator = actionCreatorFactory() import * as constants from './constants' import { IConversation, IMessageNewPayload, IReadReceiptPayload, IMessagesById } from './interfaces' export const fetchConversations = actionCreator(constants.FETCH_CONVERSATIONS) export const fetchConversationsPending = actionCreator(constants.FETCH_CONVERSATIONS_PENDING) export const fetchConversationsSuccess = actionCreator(constants.FETCH_CONVERSATIONS_SUCCESS) export const fetchConversationsFailed = actionCreator(constants.FETCH_CONVERSATIONS_FAILED) export const fetchConversationsFromInbox = actionCreator(constants.FETCH_CONVERSATIONS_FROM_INBOX) export const fetchConversationsFromInboxPending = actionCreator(constants.FETCH_CONVERSATIONS_FROM_INBOX_PENDING) export const fetchConversationsFromInboxSuccess = actionCreator(constants.FETCH_CONVERSATIONS_FROM_INBOX_SUCCESS) export const fetchConversationsFromInboxFailed = actionCreator(constants.FETCH_CONVERSATIONS_FROM_INBOX_FAILED) export const fetchMessagesForConversation = actionCreator(constants.FETCH_MESSAGES_FOR_CONVERSATION) export const fetchMessagesForConversationPending = actionCreator(constants.FETCH_MESSAGES_FOR_CONVERSATION_PENDING) export const fetchMessagesForConversationSuccess = actionCreator(constants.FETCH_MESSAGES_FOR_CONVERSATION_SUCCESS) export const fetchMessagesForConversationFailed = actionCreator(constants.FETCH_MESSAGES_FOR_CONVERSATION_FAILED) export const storeParticipantIds = actionCreator(constants.STORE_PARTICIPANT_IDS) export const participantChange = actionCreator(constants.PARTICIPANT_CHANGE) export const receiveReadReceipt = actionCreator(constants.RECIEVE_READ_RECEIPT) export const newMessageInConversation = actionCreator(constants.NEW_MESSAGE_IN_CONVERSATION) export const toggleConversationIcon = actionCreator(constants.TOGGLE_CONVERSATION_ICON) export const deleteMessagesByConversationId = actionCreator(constants.DELETE_MESSAGES_BY_CONVERSATION_ID) export const deleteConversation = actionCreator(constants.DELETE_CONVERSATION) export const newConversation = actionCreator(constants.NEW_CONVERSATION) export const updateConversation = actionCreator(constants.UPDATE_CONVERSATION) export const resetConversations = actionCreator(constants.RESET_CONVERSATIONS)