Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Commit c61c92c

Browse files
committed
Use spread instead Object.assign. Following #259
1 parent 4c17b0e commit c61c92c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/sync.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export default function syncHistoryWithStore(history, store, {
5454
// Update address bar to reflect store state
5555
isTimeTraveling = true
5656
currentLocation = locationInStore
57-
history.transitionTo(Object.assign({},
58-
locationInStore,
59-
{ action: 'PUSH' }
60-
))
57+
history.transitionTo({
58+
...locationInStore,
59+
action: 'PUSH'
60+
})
6161
isTimeTraveling = false
6262
}
6363

@@ -95,7 +95,8 @@ export default function syncHistoryWithStore(history, store, {
9595
unsubscribeFromHistory = history.listen(handleLocationChange)
9696

9797
// The enhanced history uses store as source of truth
98-
return Object.assign({}, history, {
98+
return {
99+
...history,
99100
// The listeners are subscribed to the store instead of history
100101
listen(listener) {
101102
// History listeners expect a synchronous call
@@ -124,5 +125,5 @@ export default function syncHistoryWithStore(history, store, {
124125
}
125126
unsubscribeFromHistory()
126127
}
127-
})
128+
}
128129
}

0 commit comments

Comments
 (0)