Creates a lazy memoized computation derived from other signals or memos.
The computation only runs when the getter is read and one of its dependencies changed.
Dependencies are tracked dynamically from the values read during the last execution of func.
Memos can be manually disposed. When created inside a scope, they are also disposed with that scope.
Reading a disposed memo throws SignalError.
Scope-less memos still work, but once a memo has been read it stays subscribed to its current dependencies until it is disposed.
If the memo depends on long-lived state and needs deterministic cleanup, create it inside a scope.
Creates a lazy memoized computation derived from other signals or memos.
The computation only runs when the getter is read and one of its dependencies changed.
Dependencies are tracked dynamically from the values read during the last execution of
func.Memos can be manually disposed. When created inside a scope, they are also disposed with that scope. Reading a disposed memo throws SignalError.
Scope-less memos still work, but once a memo has been read it stays subscribed to its current dependencies until it is disposed. If the memo depends on long-lived state and needs deterministic cleanup, create it inside a scope.