Memo creates a readonly reactive value equal to the return value of the given function and makes sure that function only gets executed when its dependencies change
const a = signal(1), b = signal(2)const sum = memo((prev) => a()*b() + prev, 0)sum() Copy
const a = signal(1), b = signal(2)const sum = memo((prev) => a()*b() + prev, 0)sum()
The memo function should not update other signals.
Optional
Memo creates a readonly reactive value equal to the return value of the given function and makes sure that function only gets executed when its dependencies change
The memo function should not update other signals.