Skip to content

Commit

Permalink
rename to static_params
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Sep 15, 2023
1 parent 136056a commit 9782efa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions router/src/components/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ pub fn StaticRoute<E, F, P, S>(
/// that returns a type that implements [IntoView] (like `|| view! { <p>"Show this"</p> })`
/// or `|| view! { <MyComponent/>` } or even, for a component with no props, `MyComponent`).
view: F,
/// The data required to fill any dynamic segments in the path during static rendering.
/// Creates a map of the params that should be built for a particular route.
#[prop(optional)]
static_data: Option<S>,
static_params: Option<S>,
/// The static route mode
#[prop(optional)]
mode: StaticMode,
Expand Down Expand Up @@ -193,7 +193,7 @@ where
&[Method::Get],
data,
Some(mode),
static_data.map(|s| Rc::new(s) as _),
static_params.map(|s| Rc::new(s) as _),
)
}

Expand All @@ -210,7 +210,7 @@ pub(crate) fn define_route(
methods: &'static [Method],
data: Option<Loader>,
static_mode: Option<StaticMode>,
static_data: Option<StaticData>,
static_params: Option<StaticData>,
) -> RouteDefinition {
let children = children
.map(|children| {
Expand Down Expand Up @@ -242,7 +242,7 @@ pub(crate) fn define_route(
methods,
data,
static_mode,
static_data,
static_params,
}
}

Expand Down
2 changes: 1 addition & 1 deletion router/src/extract_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ where
for route in branch.routes.iter() {
static_data_map.insert(
route.pattern.to_string(),
route.key.static_data.clone(),
route.key.static_params.clone(),
);
}
route.map(|(static_mode, path)| RouteListing {
Expand Down
2 changes: 1 addition & 1 deletion router/src/matching/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct RouteDefinition {
/// The route's preferred mode of static generation, if any
pub static_mode: Option<StaticMode>,
/// The data required to fill any dynamic segments in the path during static rendering.
pub static_data: Option<StaticData>,
pub static_params: Option<StaticData>,
}

impl std::fmt::Debug for RouteDefinition {
Expand Down

0 comments on commit 9782efa

Please sign in to comment.