From b373986e92e2d406ea5dd9961aba83b0bd32ad6e Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Sun, 7 Jan 2024 18:46:06 -0600 Subject: [PATCH] docs: Add mention of `useSignalEffect` hook in integration readmes --- packages/preact/README.md | 8 ++++++-- packages/react/README.md | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/preact/README.md b/packages/preact/README.md index 2de3cf174..6b62d16f7 100644 --- a/packages/preact/README.md +++ b/packages/preact/README.md @@ -51,15 +51,19 @@ function CounterValue() { ### Hooks -If you need to instantiate new signals inside your components, you can use the `useSignal` or `useComputed` hook. +If you need to instantiate new signals or create new side effects on signal changes inside your components, you can use the `useSignal`, `useComputed` and `useSignalEffect` hooks. ```js -import { useSignal, useComputed } from "@preact/signals"; +import { useSignal, useComputed, useSignalEffect } from "@preact/signals"; function Counter() { const count = useSignal(0); const double = useComputed(() => count.value * 2); + useSignalEffect(() => { + console.log(`Value: ${count.value}, value x 2 = ${double.value}`); + }); + return (