forked from osdio/noder-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserUI.js
More file actions
35 lines (31 loc) · 720 Bytes
/
userUI.js
File metadata and controls
35 lines (31 loc) · 720 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
32
33
34
35
import * as types from '../constants/ActionTypes';
const initialState = {
checkTokenPending: false,
clientUserInfoPending: false,
otherUserPending: false
};
export default function (state = initialState, action) {
const { type, meta={} } = action;
const { sequence={} } = meta;
switch (type) {
case types.CHECK_TOKEN:
return {
...state,
checkTokenPending: sequence.type === 'start'
};
case types.UPDATE_CLIENT_USER_INFO:
return {
...state,
clientUserInfoPending: sequence.type === 'start'
};
case types.GET_USER_INFO:
return {
...state,
otherUserPending: sequence.type === 'start'
};
case types.LOGOUT:
return initialState;
default:
return state;
}
}