React hook for managing an Alien Signals effect scope. All signals/effects created inside this scope run when the component mounts, and are stopped automatically when the component unmounts.
The created effect scope.
function ScopedEffects() { const scope = useSignalScope(); useEffect(() => { scope.run(() => { createEffect(() => { console.log('Scoped effect:', someSignal.get()); }); }); }, [scope]); return null;} Copy
function ScopedEffects() { const scope = useSignalScope(); useEffect(() => { scope.run(() => { createEffect(() => { console.log('Scoped effect:', someSignal.get()); }); }); }, [scope]); return null;}
React hook for managing an Alien Signals effect scope. All signals/effects created inside this scope run when the component mounts, and are stopped automatically when the component unmounts.