Skip to content

Commit

Permalink
todos-flow example: make domain models immutable (reduxjs#2143)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored and seantcoyote committed Jan 14, 2018
1 parent c5e575b commit 0d4ba6a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/todos-flow/src/types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export type Id = number;
export type Text = string;

export type Todo = {
id: Id,
text: Text,
completed: boolean
+id: Id,
+text: Text,
+completed: boolean
};

export type VisibilityFilter =
Expand All @@ -20,14 +20,14 @@ export type VisibilityFilter =
export type Todos = Array<Todo>;

export type State = {
todos: Todos,
visibilityFilter: VisibilityFilter
+todos: Todos,
+visibilityFilter: VisibilityFilter
};

export type Action =
{ type: 'ADD_TODO', id: Id, text: Text }
| { type: 'TOGGLE_TODO', id: Id }
| { type: 'SET_VISIBILITY_FILTER', filter: VisibilityFilter }
{ type: 'ADD_TODO', +id: Id, +text: Text }
| { type: 'TOGGLE_TODO', +id: Id }
| { type: 'SET_VISIBILITY_FILTER', +filter: VisibilityFilter }
;

export type Store = ReduxStore<State, Action>;
Expand Down

0 comments on commit 0d4ba6a

Please sign in to comment.