You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/perseus/src/template/render_ctx.rs
+102-48
Original file line number
Diff line number
Diff line change
@@ -74,11 +74,9 @@ impl RenderCtx {
74
74
75
75
Ok(())
76
76
}
77
-
/// Gets either the active state or the frozen state for the given page. If `.thaw()` has been called, thaw preferences will be registered, which this will use to decide whether to use
78
-
/// frozen or active state. If neither is available, the caller should use generated state instead.
79
-
///
80
-
/// This takes a single type parameter for the reactive state type, from which the unreactive state type can be derived.
81
-
pubfnget_active_or_frozen_page_state<R>(
77
+
/// An internal getter for the frozen state for the given page. When this is called, it will also add any frozen state
78
+
/// it finds to the page state store, overriding what was already there.
79
+
fnget_frozen_page_state_and_register<R>(
82
80
&mutself,
83
81
url:&str,
84
82
) -> Option<<R::UnrxasMakeRx>::Rx>
@@ -99,9 +97,7 @@ impl RenderCtx {
99
97
Ok(unrx) => unrx,
100
98
// The frozen state could easily be corrupted, so we'll fall back to the active state (which is already reactive)
101
99
// We break out here to avoid double-storing this and trying to make a reactive thing reactive
/// Gets either the active state or the frozen state for the given page. If `.thaw()` has been called, thaw preferences will be registered, which this will use to decide whether to use
136
+
/// frozen or active state. If neither is available, the caller should use generated state instead.
137
+
///
138
+
/// This takes a single type parameter for the reactive state type, from which the unreactive state type can be derived.
139
+
pubfnget_active_or_frozen_page_state<R>(
140
+
&mutself,
141
+
url:&str,
142
+
) -> Option<<R::UnrxasMakeRx>::Rx>
143
+
where
144
+
R:Clone + AnyFreeze + MakeUnrx,
145
+
// We need this so that the compiler understands that the reactive version of the unreactive version of `R` has the same properties as `R` itself
/// Gets either the active or the frozen global state, depending on thaw preferences. Otherwise, this is exactly the same as `.get_active_or_frozen_state()`.
/// Gets either the active or the frozen global state, depending on thaw preferences. Otherwise, this is exactly the same as `.get_active_or_frozen_state()`.
0 commit comments