File tree Expand file tree Collapse file tree 10 files changed +32
-21
lines changed
01.problem.action-reference/ui
01.solution.action-reference/ui
04.problem.revalidation/ui
04.solution.revalidation/ui
05.problem.history-revalidation/ui
05.solution.history-revalidation/ui Expand file tree Collapse file tree 10 files changed +32
-21
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,10 @@ function Root() {
56
56
const fetchPromise = fetchContent ( nextLocation )
57
57
const nextContentPromise = createFromFetch ( fetchPromise )
58
58
contentCache . set ( historyKey , nextContentPromise )
59
+ startTransition ( ( ) => setContentKey ( historyKey ) )
60
+ } else {
61
+ setContentKey ( historyKey )
59
62
}
60
-
61
- startTransition ( ( ) => setContentKey ( historyKey ) )
62
63
}
63
64
window . addEventListener ( 'popstate' , handlePopState )
64
65
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -56,9 +56,10 @@ function Root() {
56
56
const fetchPromise = fetchContent ( nextLocation )
57
57
const nextContentPromise = createFromFetch ( fetchPromise )
58
58
contentCache . set ( historyKey , nextContentPromise )
59
+ startTransition ( ( ) => setContentKey ( historyKey ) )
60
+ } else {
61
+ setContentKey ( historyKey )
59
62
}
60
-
61
- startTransition ( ( ) => setContentKey ( historyKey ) )
62
63
}
63
64
window . addEventListener ( 'popstate' , handlePopState )
64
65
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -67,9 +67,10 @@ function Root() {
67
67
const fetchPromise = fetchContent ( nextLocation )
68
68
const nextContentPromise = createFromFetch ( fetchPromise )
69
69
contentCache . set ( historyKey , nextContentPromise )
70
+ startTransition ( ( ) => setContentKey ( historyKey ) )
71
+ } else {
72
+ setContentKey ( historyKey )
70
73
}
71
-
72
- startTransition ( ( ) => setContentKey ( historyKey ) )
73
74
}
74
75
window . addEventListener ( 'popstate' , handlePopState )
75
76
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -68,9 +68,10 @@ function Root() {
68
68
const fetchPromise = fetchContent ( nextLocation )
69
69
const nextContentPromise = createFromFetch ( fetchPromise )
70
70
contentCache . set ( historyKey , nextContentPromise )
71
+ startTransition ( ( ) => setContentKey ( historyKey ) )
72
+ } else {
73
+ setContentKey ( historyKey )
71
74
}
72
-
73
- startTransition ( ( ) => setContentKey ( historyKey ) )
74
75
}
75
76
window . addEventListener ( 'popstate' , handlePopState )
76
77
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -68,9 +68,10 @@ function Root() {
68
68
const fetchPromise = fetchContent ( nextLocation )
69
69
const nextContentPromise = createFromFetch ( fetchPromise )
70
70
contentCache . set ( historyKey , nextContentPromise )
71
+ startTransition ( ( ) => setContentKey ( historyKey ) )
72
+ } else {
73
+ setContentKey ( historyKey )
71
74
}
72
-
73
- startTransition ( ( ) => setContentKey ( historyKey ) )
74
75
}
75
76
window . addEventListener ( 'popstate' , handlePopState )
76
77
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -68,9 +68,10 @@ function Root() {
68
68
const fetchPromise = fetchContent ( nextLocation )
69
69
const nextContentPromise = createFromFetch ( fetchPromise )
70
70
contentCache . set ( historyKey , nextContentPromise )
71
+ startTransition ( ( ) => setContentKey ( historyKey ) )
72
+ } else {
73
+ setContentKey ( historyKey )
71
74
}
72
-
73
- startTransition ( ( ) => setContentKey ( historyKey ) )
74
75
}
75
76
window . addEventListener ( 'popstate' , handlePopState )
76
77
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ function Root() {
98
98
const fetchPromise = fetchContent ( nextLocation )
99
99
const nextContentPromise = createFromFetch ( fetchPromise )
100
100
contentCache . set ( historyKey , nextContentPromise )
101
+ // 🐨 swap this with updateContentKey
102
+ startTransition ( ( ) => setContentKey ( historyKey ) )
103
+ } else {
104
+ // 🐨 swap this with updateContentKey
105
+ setContentKey ( historyKey )
101
106
}
102
-
103
- // 🐨 swap this with updateContentKey
104
- startTransition ( ( ) => setContentKey ( historyKey ) )
105
107
}
106
108
window . addEventListener ( 'popstate' , handlePopState )
107
109
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -96,9 +96,10 @@ function Root() {
96
96
const fetchPromise = fetchContent ( nextLocation )
97
97
const nextContentPromise = createFromFetch ( fetchPromise )
98
98
contentCache . set ( historyKey , nextContentPromise )
99
+ startTransition ( ( ) => updateContentKey ( historyKey ) )
100
+ } else {
101
+ updateContentKey ( historyKey )
99
102
}
100
-
101
- updateContentKey ( historyKey )
102
103
}
103
104
window . addEventListener ( 'popstate' , handlePopState )
104
105
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -105,9 +105,10 @@ function Root() {
105
105
106
106
// if we don't have this key in the cache already, set it now
107
107
contentCache . set ( historyKey , nextContentPromise )
108
+ startTransition ( ( ) => updateContentKey ( historyKey ) )
109
+ } else {
110
+ updateContentKey ( historyKey )
108
111
}
109
-
110
- updateContentKey ( historyKey )
111
112
}
112
113
window . addEventListener ( 'popstate' , handlePopState )
113
114
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -102,9 +102,10 @@ function Root() {
102
102
if ( ! contentCache . has ( historyKey ) ) {
103
103
// if we don't have this key in the cache already, set it now
104
104
contentCache . set ( historyKey , nextContentPromise )
105
+ startTransition ( ( ) => updateContentKey ( historyKey ) )
106
+ } else {
107
+ updateContentKey ( historyKey )
105
108
}
106
-
107
- updateContentKey ( historyKey )
108
109
}
109
110
window . addEventListener ( 'popstate' , handlePopState )
110
111
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
You can’t perform that action at this time.
0 commit comments