Function useSignalEffect

  • React hook for running a side effect whenever Alien Signals' dependencies used in fn change. The effect is cleaned up on component unmount.

    Parameters

    • fn: () => void

      The effect function to run.

    Returns void

    function Logger() {
    useSignalEffect(() => {
    console.log('Signal changed:', someSignal.get());
    });
    return null;
    }