Fix code style in README.md. (#72)

This commit is contained in:
Jasin Yip 2017-05-23 18:24:10 +08:00 committed by Aaron Jensen
parent c44b3126f8
commit edacd4b839

View File

@ -161,16 +161,16 @@ expect(result).to.eql({ scores: { team1: 0, team2: 1 } });
Non-trivial array manipulations, such as element removal/insertion/sorting, can be implemented with functions. Because there are so many possible manipulations, we don't provide any helpers and leave this up to you. Simply ensure your function is pure and does not mutate its arguments.
```js
function addTodo(todos) { return [].concat(todos, [{done: false}]); }
function addTodo(todos) { return [].concat(todos, [{ done: false }]); }
var state = {
todos: [
{done: false},
{done: false}
{ done: false },
{ done: false }
]
};
var result = u({ todos: addTodo }, state);
expect(result).to.eql({ todos: [{ done: false}, { done: false }, { done: false }]});
expect(result).to.eql({ todos: [{ done: false }, { done: false }, { done: false }]});
```
#### When null or undefined object, updeep uses a default object