Skip to content

Commit c748b33

Browse files
committed
updated docs per pr comments
1 parent bea7308 commit c748b33

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

docs/configuration.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -707,13 +707,14 @@ window.$docsify = {
707707

708708
// RegEx match w/ asynchronous function
709709
'/baz/(.*)': function(route, matched, next) {
710-
try {
711-
// Async task(s)...
712-
} catch (err) {
713-
// ...
714-
} finally {
715-
next('# Custom Markdown');
716-
}
710+
// Requires `fetch` polyfill for legacy browsers (https://github.github.io/fetch/)
711+
fetch('/api/users?id=12345')
712+
.then(function(response) {
713+
next('# Custom Markdown');
714+
})
715+
.catch(function(err) {
716+
// Handle error...
717+
});
717718
}
718719
}
719720
}
@@ -738,13 +739,8 @@ window.$docsify = {
738739
if (matched[0] === 'cats') {
739740
next();
740741
} else {
741-
try {
742-
// Async task(s)...
743-
} catch (err) {
744-
// ...
745-
} finally {
746-
next('I like all pets but cats');
747-
}
742+
// Async task(s)...
743+
next('I like all pets but cats');
748744
}
749745
}
750746
}

0 commit comments

Comments
 (0)