File tree 1 file changed +10
-14
lines changed
1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -707,13 +707,14 @@ window.$docsify = {
707
707
708
708
// RegEx match w/ asynchronous function
709
709
' /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
+ });
717
718
}
718
719
}
719
720
}
@@ -738,13 +739,8 @@ window.$docsify = {
738
739
if (matched[0 ] === ' cats' ) {
739
740
next ();
740
741
} 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' );
748
744
}
749
745
}
750
746
}
You can’t perform that action at this time.
0 commit comments