The provided function will be called immediately, and again every
time a signal that was read by the function changes.
Parameters
fn: ()=>void|Disposifiable
Returns Disposable
Example
constsig = Signal.from("Hello Joe!"); effect(() =>console.log("Signal value is:", sig.get())); // prints "Signal value is: Hello Joe!" sig.set("Hello Mike!"); // prints "Signal value is: Hello Mike!"
Create an effect responding to signal changes.
The provided function will be called immediately, and again every time a signal that was read by the function changes.