Skip to content

Commit

Permalink
style: use const instead of let (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
DDtKey authored Feb 15, 2024
1 parent 12e69d9 commit 3c8cd59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/web-ui/src/components/buckets_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ use leptos::{component, create_effect, view, IntoView, MaybeSignal, SignalWith};

#[component]
pub(crate) fn BucketsChart(#[prop(into)] buckets: MaybeSignal<Buckets>) -> impl IntoView {
let id = "buckets-chart";
const ID: &str = "buckets-chart";

// re-render chart on `buckets` change
create_effect(move |_| {
buckets.with(|buckets| {
log::debug!("re-rendering buckets chart");
let chart: Scatter<NoAnnotations> = Scatter {
id: id.to_string(),
id: ID.to_string(),
options: ChartOptions {
scales: Some(HashMap::from([
(
Expand Down Expand Up @@ -62,6 +62,6 @@ pub(crate) fn BucketsChart(#[prop(into)] buckets: MaybeSignal<Buckets>) -> impl
});

view! {
<canvas id={id}></canvas>
<canvas id={ID}></canvas>
}
}

0 comments on commit 3c8cd59

Please sign in to comment.