-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jose Buitron
committed
May 14, 2018
1 parent
3fa2f33
commit 8cebe80
Showing
13 changed files
with
141 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": ["latest", "react"], | ||
"plugins": [ | ||
"transform-object-rest-spread" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "laboratoria-419ca" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
bundle.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createAction } from 'redux-actions' | ||
|
||
export const authSuccess = createAction('AUTH_SUCCESS') | ||
export const authFail = createAction('AUTH_FAIL') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
import { handleActions } from 'redux-actions' | ||
|
||
import * as actions from './auth.actions' | ||
|
||
const initialState = { | ||
isAuthenticated: false | ||
} | ||
|
||
const authReducer = (state = initialState , action) => { | ||
switch (action.type) { | ||
case 'AUTH_SUCCESS': | ||
return { | ||
...state, | ||
isAuthenticated: true | ||
} | ||
case 'AUTH_FAIL': | ||
return { | ||
...state, | ||
isAuthenticated: false | ||
} | ||
default: | ||
return state | ||
} | ||
} | ||
export default handleActions({ | ||
[actions.authSuccess]: (state, action) => ({ | ||
...state, | ||
isAuthenticated: true | ||
}), | ||
[actions.authFail]: (state, action) => ({ | ||
...state, | ||
isAuthenticated: false | ||
}) | ||
}, initialState) | ||
|
||
export default authReducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { createAction } from 'redux-actions' | ||
|
||
export const postAdd = createAction('POST_ADD') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { handleActions } from 'redux-actions' | ||
|
||
import * as actions from './posts.actions' | ||
|
||
const initialState = { | ||
list: [] | ||
} | ||
|
||
export default handleActions({ | ||
[actions.postAddSuccess]: (state, action) => ({ | ||
...state, | ||
list: [ ...state.list, action.payload ] | ||
}) | ||
}, initialState) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { combineReducers } from 'redux' | ||
|
||
import auth from './auth/auth.reducer' | ||
import posts from './posts/posts.reducer' | ||
|
||
|
||
export default combineReducers({ | ||
auth, | ||
auth, | ||
posts, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters