File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments