@samitouri / QOS-React / commits / e958cdbd36

Fix object spread operator (#8378)

Object spread operator performs shallow copy of object's arguments, so it should be placed before new properties are assigned.

Mikhail Osher committed Nov 22, 2016 at 18:01 UTC e958cdbd36ea6c715a4ff14a0cc5b81a9a703040
1 file changed +1 -1
docs/tutorial/tutorial.md
+1 -1
@@ -226,7 +226,7 @@ var newPlayer = Object.assign({}, player, {score: 2});
226 // Now player is unchanged, but newPlayer is {score: 2, name: 'Jeff'}
227
228 // Or if you are using object spread, you can write:
229 -// var newPlayer = {score: 2, ...player};
229 +// var newPlayer = {...player, score: 2};
230 ```
231
232 The end result is the same but by not mutating (or changing the underlying data) directly we now have an added benefit that can help us increase component and overall application performance.