Fusuma

Components / Lists and updates

memo

view, skipped while value stays the same.

How it looks

Drawn by the toolkit from the example below. No page of the gallery uses memo yet, so there is nothing to run.

memo drawn by Fusuma

view, skipped while value stays the same.

value stands for what the view is made from: when it is the same as last time the whole subtree is left alone. Pick a value that changes whenever the view would (a counter you bump, a hash with stamp).

Signature

pub const fn memo<V>(value: u16, view: V) -> Memo<V>

Example

use fusuma::{memo, text};
let version = 3;
let view = memo(version, text("An expensive part"));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["An expensive part"]);

All components · Source