File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ node_modules/*
2
2
public /*
3
3
build /*
4
4
config /*
5
+ dist /*
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ const JsExercise = ({ match }) => {
57
57
} , [ data , match ] ) ;
58
58
59
59
Prism . highlightAll ( ) ;
60
+
60
61
useEffect ( ( ) => {
61
62
import ( `../../../data/javascript/${ match . params . exercise } /index.json` ) . then (
62
63
json => {
@@ -71,6 +72,20 @@ const JsExercise = ({ match }) => {
71
72
} ) ;
72
73
} , [ match ] ) ;
73
74
75
+ useEffect ( ( ) => {
76
+ // preload next question
77
+ console . log (
78
+ 'match' ,
79
+ match . params . exercise ,
80
+ 'next question' ,
81
+ nextQuestion . key ,
82
+ ) ;
83
+ import (
84
+ `!raw-loader! ../../../data/javascript/${ nextQuestion . key } /question.js`
85
+ ) ;
86
+ import ( `../../../data/javascript/${ nextQuestion . key } /index.json` ) ;
87
+ } , [ match , nextQuestion ] ) ;
88
+
74
89
return (
75
90
< Container className = "mt-3 mb-3" >
76
91
< h2 > { data . title } </ h2 >
You can’t perform that action at this time.
0 commit comments