Skip to content

Commit

Permalink
Merge pull request #439 from AsaAyers/immutable-utils
Browse files Browse the repository at this point in the history
Fix ImmutableUtils docs
  • Loading branch information
goatslacker committed Aug 5, 2015
2 parents 868b3f5 + db72f86 commit e55a84b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/utils/immutable.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ If you don't wish to use ES7 decorators then no problem, they're just sugar for

```js
function TodoStore() {
this.state = {
this.state = Immutable.Map({
todos: Immutable.Map({})
};
});
}
TodoStore.displayName = 'TodoStore';

Expand All @@ -61,18 +61,18 @@ Using your ImmutableStore is a bit different from using a regular store:

```js
function TodoStore() {
this.state = {
this.state = Immutable.Map({
todos: Immutable.Map({})
};
});

this.bindListeners({
addTodo: TodoActions.addTodo
});
}

TodoStore.properties.addTodo = function (todo) {
TodoStore.prototype.addTodo = function (todo) {
var id = String(Math.random());
this.setState(this.state.todos.set(id, todo));
this.setState(this.state.setIn(['todos', id], todo));
};

TodoStore.displayName = 'TodoStore';
Expand Down

0 comments on commit e55a84b

Please sign in to comment.