-
Notifications
You must be signed in to change notification settings - Fork 0
/
devDocs.txt
51 lines (42 loc) · 1.25 KB
/
devDocs.txt
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
--------------------------------
NPM
--------------------------------
Rollback a NPM Package or installing a new NPM Package:
npm install packagename@version
If you want the default styling, include the component's CSS with
import "react-toggle/style.css" // for ES6 modules
// or
require("react-toggle/style.css") // for CommonJS
--------------------------------
REACT
--------------------------------
AUTHENTICATION:
*
src\store.js
*
src\_actions\_types\auth.types.js
src\_actions\_types\error.types.js
*
src\_reducers\authReducer.js
src\_reducers\errorReducer.js
*
src\_actions\authActions.js
src\_actions\errorActions.js
action_type | reducer | action
Dispatch - Hey! Do this action
Action - Yes Boss. Hello Reducer, user have triggered me(action), check all your(reducer) conditions and do the funcionalities written for me(action)
AUTHENTICATION-PROCESS-FLOW:
#1 - Here, Dispatch - Hey! Do this action
src\App.js
useEffect(() => {
store.dispatch(loaderUser());
}, []);
#2
src\_actions\authActions.js
loaderUser = () => (dispatch, getState) => {
//User Loading
dispatch({type: authTypes.USER_LOADING})
}
Now, this is the action triggred, check the reducers & do the funcionalities for this action
#3
src\_reducers\authReducer.js