Skip to content

Commit

Permalink
Fix formatting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Apr 23, 2019
1 parent eb2938c commit ff1e327
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions docs/basics/ExampleTodoList.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ const todos = (state = [], action) => {
}
]
case 'TOGGLE_TODO':
return state.map(todo =>
todo.id === action.id ? { ...todo, completed: !todo.completed } : todo
return state.map(
todo =>
todo.id === action.id ? { ...todo, completed: !todo.completed } : todo
)
default:
return state
Expand Down
9 changes: 5 additions & 4 deletions docs/introduction/CoreConcepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ function todos(state = [], action) {
case 'ADD_TODO':
return state.concat([{ text: action.text, completed: false }])
case 'TOGGLE_TODO':
return state.map((todo, index) =>
action.index === index
? { text: todo.text, completed: !todo.completed }
: todo
return state.map(
(todo, index) =>
action.index === index
? { text: todo.text, completed: !todo.completed }
: todo
)
default:
return state
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export function combineReducers<T extends ReducersMapObject<any, any>>(
reducers: T
): Reducer<InferStateType<T>, InferActionTypes<InferReducerTypes<T>>>

type InferActionTypes<R> = R extends Reducer<any, infer A> ? A : AnyAction;
type InferReducerTypes<T> = T extends Record<any, infer R> ? R : Reducer;
type InferStateType<T> = T extends ReducersMapObject<infer S, any> ? S : never;
type InferActionTypes<R> = R extends Reducer<any, infer A> ? A : AnyAction
type InferReducerTypes<T> = T extends Record<any, infer R> ? R : Reducer
type InferStateType<T> = T extends ReducersMapObject<infer S, any> ? S : never

/* store */

Expand Down

0 comments on commit ff1e327

Please sign in to comment.