forked from Vizzuality/mangrove-atlas
-
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.
feat(Vizzuality#12): Create search schema.
- Loading branch information
Migsar Navarro
committed
Jun 5, 2019
1 parent
bb2ad58
commit 9672963
Showing
5 changed files
with
36 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createAction } from 'vizzuality-redux-tools'; | ||
|
||
export const setSearch = createAction('SEARCH/setSearch'); | ||
export const setSearchTerm = createAction('SEARCH/setSearchTerm'); | ||
export const setSearchResults = createAction('SEARCH/setSearchResults'); | ||
|
||
export default { | ||
setSearch, | ||
setSearchTerm, | ||
setSearchResults | ||
}; |
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 @@ | ||
import * as actions from './actions'; | ||
import * as reducers from './reducers'; | ||
import initialState from './initial-state'; | ||
|
||
export { actions, initialState, reducers }; |
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 @@ | ||
export default { | ||
term: '', | ||
results: [] | ||
}; |
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,13 @@ | ||
import * as actions from './actions'; | ||
|
||
const { | ||
setSearch, | ||
setSearchTerm, | ||
setSearchResults | ||
} = actions; | ||
|
||
export default { | ||
[setSearch]: (state, { payload }) => ({ ...state, ...payload }), | ||
[setSearchTerm]: (state, { payload }) => ({ ...state, term: payload }), | ||
[setSearchResults]: (state, { payload }) => ({ ...state, results: payload }) | ||
}; |