forked from osdio/noder-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.js
More file actions
25 lines (22 loc) · 699 Bytes
/
message.js
File metadata and controls
25 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {createAction} from 'redux-actions'
import * as types from '../constants/ActionTypes'
import * as messageService from '../services/messageService'
export const getUnreadMessageCount = createAction(types.GET_UNREAD_MESSAGE_COUNT, async() => {
return await messageService.getUnreadMessageCount()
})
export const markAsRead = createAction(types.MARK_AS_READ, async() => {
return await messageService.markAsRead()
}, function (resolved, rejected) {
return {
resolved,
rejected,
sync: 'message'
}
})
export const getMessageList = createAction(types.GET_MESSAGES_LIST, async() => {
return await messageService.getMessages()
}, () => {
return {
sync: 'message'
}
})