Table of Contents

Method Memoized

Namespace
Velvet
Assembly
Velvet.Docs.dll

Memoized(Func<VNode>, params object?[]?)

Memoization node. Skips rebuilding the child subtree while the dependency array is unchanged. When key is omitted, the order of MemoNodes within the same component must remain stable, since identity is resolved by call order. If the order can change dynamically, use MemoizedWithKey(string?, Func<VNode>, params object?[]?) instead. This is distinct from Memo<TProps>(Func<TProps, VNode>, TProps, Func<TProps, TProps, bool>, string?), which memoizes a function-style component by props equality.

public static MemoNode Memoized(Func<VNode> factory, params object?[]? deps)

Parameters

factory Func<VNode>

Factory invoked to produce the cached VNode when deps change.

deps object[]

Dependency values. When deeply equal to the previous render, the cached VNode is reused.

Returns

MemoNode

The created MemoNode.