Skip to content

Commit

Permalink
todos-flow example: make domain models immutable (#2143)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored and timdorr committed Dec 9, 2016
1 parent 18a3e46 commit 3a8bb68
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

1 comment on commit 3a8bb68

@jali
Copy link

@jali jali commented on 3a8bb68 Jan 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't look healthy

Please sign in to comment.