Skip to content

Commit

Permalink
Publish v0.10.0-alpha.2
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz committed Jan 8, 2024
1 parent ae13309 commit bf7ea52
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 8 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "viewbuilder"
version = "0.10.0-alpha.1"
version = "0.10.0-alpha.2"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Cross-platform UI framework"
Expand All @@ -18,6 +18,7 @@ web = ["web-sys"]
full = ["web", "tracing"]

[dependencies]
rustc-hash = "1.1.0"
tracing = { version = "0.1.40", optional = true }

[dependencies.web-sys]
Expand Down
5 changes: 3 additions & 2 deletions src/view/lazy.rs
@@ -1,12 +1,13 @@
use crate::View;
use std::hash::{DefaultHasher, Hash, Hasher};
use std::hash::{ Hash, Hasher};
use rustc_hash::FxHasher;

/// Create a lazy view that only renders when the given value changes.
pub fn lazy<T, M, V>(value: impl Hash, view: V) -> Lazy<V>
where
V: View<T, M>,
{
let mut hasher = DefaultHasher::new();
let mut hasher = FxHasher::default();
value.hash(&mut hasher);
let hash = hasher.finish();

Expand Down

0 comments on commit bf7ea52

Please sign in to comment.