]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: use flatMap instead of map + flat (#290)
authorJason Yu <me@ycmjason.com>
Sat, 6 Jun 2020 11:13:37 +0000 (12:13 +0100)
committerGitHub <noreply@github.com>
Sat, 6 Jun 2020 11:13:37 +0000 (13:13 +0200)
README.md

index 1ee06c777701a5af72b4b36183297c56cc2b0323..a6247bc6aa2ea15a7b5d2f8421dbd78bdeee0d26 100644 (file)
--- a/README.md
+++ b/README.md
@@ -30,8 +30,7 @@ Check the [playground](https://github.com/vuejs/vue-router-next/tree/master/play
 - `router.getMatchedComponents` is now removed as they can be retrieved from `router.currentRoute.value.matched`:
   ```js
   router.currentRoute.value.matched
-    .map(record => Object.values(record.components))
-    .flat()
+    .flatMap(record => Object.values(record.components))
   ```
 - If you use a `transition`, you may need to wait for the router to be _ready_ before mounting the app:
   ```js