Skip to content

Commit 6484181

Browse files
srimolatimdorr
authored andcommitted
Remove unnecessary newlines (#2937)
1 parent 9478a8d commit 6484181

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs/recipes/UsingObjectSpreadOperator.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Using Object Spread Operator
22

3-
Since one of the core tenets of Redux is to never mutate state, you'll often find yourself using [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) to create
4-
copies of objects with new or updated values. For example, in the `todoApp` below `Object.assign()` is used to return a new
5-
`state` object with an updated `visibilityFilter` property:
3+
Since one of the core tenets of Redux is to never mutate state, you'll often find yourself using [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) to create copies of objects with new or updated values. For example, in the `todoApp` below `Object.assign()` is used to return a new `state` object with an updated `visibilityFilter` property:
64

75
```js
86
function todoApp(state = initialState, action) {
@@ -19,8 +17,7 @@ function todoApp(state = initialState, action) {
1917

2018
While effective, using `Object.assign()` can quickly make simple reducers difficult to read given its rather verbose syntax.
2119

22-
An alternative approach is to use the [object spread syntax](https://github.com/sebmarkbage/ecmascript-rest-spread) proposed for the next versions of JavaScript which lets you use the spread (`...`) operator to copy enumerable properties from one object to another in a more succinct way. The object spread operator is conceptually similar to the ES6 [array spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). We
23-
can simplify the `todoApp` example above by using the object spread syntax:
20+
An alternative approach is to use the [object spread syntax](https://github.com/sebmarkbage/ecmascript-rest-spread) proposed for the next versions of JavaScript which lets you use the spread (`...`) operator to copy enumerable properties from one object to another in a more succinct way. The object spread operator is conceptually similar to the ES6 [array spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). We can simplify the `todoApp` example above by using the object spread syntax:
2421

2522
```js
2623
function todoApp(state = initialState, action) {

0 commit comments

Comments
 (0)