diff options
author | tanhengyeow <E0032242@u.nus.edu> | 2020-06-11 02:36:44 +0800 |
---|---|---|
committer | tanhengyeow <E0032242@u.nus.edu> | 2020-06-11 02:36:44 +0800 |
commit | 7906ded0616aac733ab0795aa6e29e1fdf3279c2 (patch) | |
tree | f4297674e02897ba8c549baff5fd8f64aaf855fa | |
parent | 855e4152323a6e34222b2f5cfb5d9bc23fc8d42b (diff) | |
download | libeufin-7906ded0616aac733ab0795aa6e29e1fdf3279c2.tar.gz libeufin-7906ded0616aac733ab0795aa6e29e1fdf3279c2.tar.bz2 libeufin-7906ded0616aac733ab0795aa6e29e1fdf3279c2.zip |
Update reducers folder
-rw-r--r-- | frontend/src/reducers/index.tsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/frontend/src/reducers/index.tsx b/frontend/src/reducers/index.tsx new file mode 100644 index 00000000..76e2d0c0 --- /dev/null +++ b/frontend/src/reducers/index.tsx @@ -0,0 +1,22 @@ +import { Authenticate, Unauthenticate } from '../actions/auth'; +import { AUTHENTICATE, UNAUTHENTICATE } from '../constants'; +import { Store } from '../types'; + +export default function rootReducer( + state: Store = { + isAuthenticated: false, + }, + action: Authenticate | Unauthenticate +): Store { + switch (action.type) { + case AUTHENTICATE: + return { + ...state, + isAuthenticated: true, + }; + case UNAUTHENTICATE: + return { ...state, isAuthenticated: false }; + default: + return state; + } +} |