-
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: get db schema to improve cmd hints (#61)
Co-authored-by: Adrián Insua Yañez <[email protected]>
- Loading branch information
1 parent
9f6b5b3
commit 8a28f03
Showing
18 changed files
with
262 additions
and
210 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
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
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,10 @@ | ||
import { useDispatch } from "react-redux" | ||
|
||
export const useAsyncDispatch = () => { | ||
const dispatch = useDispatch(); | ||
|
||
return async (action, method) => { | ||
const result = await method; | ||
dispatch(action(result)); | ||
} | ||
} |
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,12 @@ | ||
import { DBPROPERTIES } from "../reducers/db" | ||
|
||
const setProperties = (properties) => { | ||
return { | ||
type: DBPROPERTIES, | ||
properties | ||
} | ||
} | ||
|
||
export default { | ||
setProperties | ||
} |
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,9 +1,11 @@ | ||
import userActions from './user'; | ||
import themeActions from './theme'; | ||
import user from './user'; | ||
import theme from './theme'; | ||
import db from './db'; | ||
|
||
const allActions = { | ||
userActions, | ||
themeActions | ||
const actions = { | ||
user, | ||
theme, | ||
db | ||
} | ||
|
||
export default allActions; | ||
export default actions; |
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,15 @@ | ||
export const DBPROPERTIES = 'SET_DB_PROPERTIES'; | ||
|
||
const dbSchema = (state = {}, action) => { | ||
switch (action.type) { | ||
case DBPROPERTIES: | ||
return { | ||
...state, | ||
...action.properties | ||
} | ||
default: | ||
return state; | ||
} | ||
}; | ||
|
||
export default dbSchema; |
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,10 +1,12 @@ | ||
import currentUser from "./user"; | ||
import currentTheme from './theme'; | ||
import dbSchema from './db'; | ||
import { combineReducers } from "redux"; | ||
|
||
const rootReducer = combineReducers({ | ||
currentUser, | ||
currentTheme | ||
currentTheme, | ||
dbSchema | ||
}); | ||
|
||
export default rootReducer; |
Oops, something went wrong.