-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
5b5b630
commit 6542d2d
Showing
7 changed files
with
52 additions
and
12 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
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import { UM_GET_USERS } from './types' | ||
import { UM_GET_USERS, UM_UPDATE_USERS_RESPONSE } from './types' | ||
|
||
export const getUsers = (action) => ({ | ||
type: UM_GET_USERS, | ||
payload: { action }, | ||
}) | ||
|
||
export const updateUserResponse = (action) => ({ | ||
type: UM_UPDATE_USERS_RESPONSE, | ||
payload: { action }, | ||
}) |
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
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,29 @@ | ||
import { UM_UPDATE_USERS_RESPONSE } from '../actions/types' | ||
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry' | ||
|
||
const INIT_STATE = { | ||
items: [], | ||
loading: false, | ||
} | ||
const reducerName = 'userReducer' | ||
|
||
export default function userReducer(state = INIT_STATE, action) { | ||
switch (action.type) { | ||
case UM_UPDATE_USERS_RESPONSE: | ||
console.log(action) | ||
return { | ||
...state, | ||
loading: false, | ||
} | ||
default: | ||
return handleDefault() | ||
} | ||
|
||
function handleDefault() { | ||
return { | ||
...state, | ||
loading: false, | ||
} | ||
} | ||
} | ||
reducerRegistry.register(reducerName, userReducer) |
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