-
Notifications
You must be signed in to change notification settings - Fork 1
/
reducer.js
73 lines (64 loc) · 1.71 KB
/
reducer.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// import ActionTypes from '../constant/constant';
const INITIAL_STATE = {
userName: 'Anas Khan',
currentUser:"",
users: [],
messages: {},
recipientID: '',
initailState:[],
// seen:false,
// time:""
// portfolios: [{ userName: "Anas khan", profession: "student", apprence: "look like shk" }
// , { userName: "Ahmed", profession: "teacher", apprence: "look like salman" }
// ]
}
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case "USERNAME":
return ({
...state,
userName: action.payload,
})
case "CHKFUN":
return ({
...state,
initailState: action.payload,
})
case "CURRENTUSER":
return ({
...state,
currentUser: action.payload
})
case "ALLUSERS":
return ({
...state,
users: action.payload
})
case" LOGIN":
return ({
...state,
messages: action.payload,
})
case "TYPEPORTFOLOIO":
return ({
...state,
portfolios: action.payload,
})
case "SIGNUP":
return({
...state,
})
case "CHANGERECPUID":
return ({
...state,
recipientID: action.payload
})
case "MESSAGES":
return ({
...state,
messages:action.payload
})
default:
return state;
}
}