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
28 lines (22 loc) · 704 Bytes
/
message.js
File metadata and controls
28 lines (22 loc) · 704 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
26
27
28
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.req.getUnreadMessageCount();
});
export const markAsRead = createAction(types.MARK_AS_READ, async()=> {
return await messageService.req.markAsRead();
}, function (resolved, rejected) {
return {
resolved,
rejected,
sync: 'message'
}
});
export const getMessageList = createAction(types.GET_MESSAGES_LIST, async()=> {
return await messageService.req.getMessages();
}, ()=> {
return {
sync: 'message'
}
});