Skip to content

Commit ab9fef2

Browse files
Fix code example error in create-effect.mdx (#1261)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent b506821 commit ab9fef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/reference/basic-reactivity/create-effect.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const [a, setA] = createSignal(initialValue)
3535
// effect that depends on signal `a`
3636
createEffect((prevSum) => {
3737
// do something with `a` and `prevSum`
38-
const sum = a() + b()
38+
const sum = a() + prevSum
3939
if (sum !== prevSum) console.log("sum changed to", sum)
4040
return sum
4141
}, 0)

0 commit comments

Comments
 (0)