Skip to content

Commit ab802e2

Browse files
committed
add more types to the settings reducer
1 parent e5ccbf8 commit ab802e2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

source/flux/parts/settings.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,25 @@ function credentialsReducer(
143143
}
144144
}
145145

146-
const initialSettingsState = {
146+
export type SettingsState = {
147+
theme: string,
148+
dietaryPreferences: [],
149+
credentials: CredentialsState,
150+
feedbackDisabled: boolean,
151+
}
152+
153+
const initialSettingsState: SettingsState = {
147154
theme: 'All About Olaf',
148155
dietaryPreferences: [],
149156

150-
credentials: undefined,
151-
token: undefined,
157+
credentials: initialCredentialsState,
152158
feedbackDisabled: false,
153159
}
154-
export function settings(state: Object = initialSettingsState, action: Object) {
160+
161+
export function settings(
162+
state: SettingsState = initialSettingsState,
163+
action: Object,
164+
) {
155165
// start out by running the reducers for the complex chunks of the state
156166
state = {
157167
...state,

0 commit comments

Comments
 (0)