-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathindex.ts
More file actions
31 lines (27 loc) · 713 Bytes
/
index.ts
File metadata and controls
31 lines (27 loc) · 713 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
29
30
31
export const SEND_MESSAGE_RESPONSE = 'SEND_MESSAGE_RESPONSE';
export const MESSAGE_SENT = 'MESSAGE_SENT';
export const SEND_MESSAGE_REQUEST = 'SEND_MESSAGE_REQUEST';
export const USER_CHANGED = 'USER_CHANGED';
export const messageReceived = (message: { from: string, content: string, time: string }) => {
return {
type: SEND_MESSAGE_RESPONSE,
message
};
};
export const sendMessage = (message: { from: string, content: string, time: string }) => {
return {
type: SEND_MESSAGE_REQUEST,
message
};
};
export const messageSent = () => {
return {
type: MESSAGE_SENT
};
};
export const changeUsername = (username: string) => {
return {
type: USER_CHANGED,
username
};
};