]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor(guards): remove bind usage
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 11 Mar 2021 15:27:03 +0000 (16:27 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 11 Mar 2021 15:27:03 +0000 (16:27 +0100)
Sorry Ben... ðŸ˜…

src/router.ts

index d2c421a7f48ee6db1b1b4160528573f203cb98d4..14158f6d4933b20204ce03b0248819c3f7aea89b 100644 (file)
@@ -1167,14 +1167,14 @@ function extractChangingRecords(
   for (let i = 0; i < len; i++) {
     const recordFrom = from.matched[i]
     if (recordFrom) {
-      if (to.matched.find(isSameRouteRecord.bind(null, recordFrom)))
+      if (to.matched.find(record => isSameRouteRecord(record, recordFrom)))
         updatingRecords.push(recordFrom)
       else leavingRecords.push(recordFrom)
     }
     const recordTo = to.matched[i]
     if (recordTo) {
       // the type doesn't matter because we are comparing per reference
-      if (!from.matched.find(isSameRouteRecord.bind(null, recordTo))) {
+      if (!from.matched.find(record => isSameRouteRecord(record, recordTo))) {
         enteringRecords.push(recordTo)
       }
     }