Add placeholder store for config

This commit is contained in:
Melvin Valster
2019-07-29 22:30:12 +02:00
parent ddac625759
commit 483a0aa549
7 changed files with 34 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
export {}
+14
View File
@@ -0,0 +1,14 @@
import {
ConfigState, ConfigActionTypes
} from './types'
const initialState: ConfigState = {
alwaysShowPoints: false
}
export default function(state = initialState, action: ConfigActionTypes): ConfigState {
switch (action.type) {
default:
return state
}
}
+13
View File
@@ -0,0 +1,13 @@
export interface ConfigState {
alwaysShowPoints: boolean
}
export const SET_CONFIG_VALUE = 'SET_CONFIG_VALUE'
interface SetConfigValueAction {
type: typeof SET_CONFIG_VALUE
key: string
value: any
}
export type ConfigActionTypes = SetConfigValueAction
+2
View File
@@ -1,8 +1,10 @@
import { createStore, combineReducers, compose } from 'redux'
import calculator from './calculator/reducers'
import config from './config/reducers'
const rootReducer = combineReducers({
calculator,
config
})
export type AppState = ReturnType<typeof rootReducer>