Skip to content

Commit 64bb659

Browse files
committed
small edits
1 parent bf74e6d commit 64bb659

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class Router {
284284
_addRoute (path, handler, segments) {
285285
guardComponent(path, handler)
286286
handler.path = path
287-
handler.fullPath = (segments.reduce(function (path, segment) {
287+
handler.fullPath = (segments.reduce((path, segment) => {
288288
return path + segment.path
289289
}, '') + path).replace('//', '/')
290290
segments.push({

src/pipeline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ function loadData (component, transition, hook, cb, cleanup) {
264264
transition.callHooks(hook, component, (data, onError) => {
265265
// merge data from multiple data hooks
266266
if (Array.isArray(data) && data._needMerge) {
267-
data = data.reduce(function (res, obj) {
267+
data = data.reduce((res, obj) => {
268268
if (isPlainObject(obj)) {
269269
Object.keys(obj).forEach(key => {
270270
res[key] = obj[key]

src/transition.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ export default class RouteTransition {
3838

3939
// the activate queue is an array of route handlers
4040
// that need to be activated
41-
this.activateQueue = matched.map(function (match) {
42-
return match.handler
43-
})
41+
this.activateQueue = matched.map(match => match.handler)
4442
}
4543

4644
/**
@@ -139,9 +137,7 @@ export default class RouteTransition {
139137
transition.router._onTransitionValidated(transition)
140138

141139
// trigger reuse for all reused views
142-
reuseQueue && reuseQueue.forEach(function (view) {
143-
reuse(view, transition)
144-
})
140+
reuseQueue && reuseQueue.forEach(view => reuse(view, transition))
145141

146142
// the root of the chain that needs to be replaced
147143
// is the top-most non-reusable view.

0 commit comments

Comments
 (0)