Skip to content

Commit

Permalink
Fix: use count() in createEffect on State Management page (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sc1pex authored Jul 18, 2024
1 parent 358885d commit d1ec214
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/guides/state-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function Counter() {
};

createEffect(() => {
setDoubleCount((prev) => prev * 2); // Update doubleCount whenever count changes
setDoubleCount(count() * 2); // Update doubleCount whenever count changes
});

return (
Expand Down Expand Up @@ -173,7 +173,7 @@ function Counter() {
};

createEffect(() => {
setDoubleCount((prev) => prev * 2); // Update doubleCount whenever count changes
setDoubleCount(count() * 2); // Update doubleCount whenever count changes
});

const doubleCount = () => count() * 2
Expand Down Expand Up @@ -295,7 +295,7 @@ function App() {
const squaredCount = createMemo(() => count() * count());

createEffect(() => {
setDoubleCount((prev) => prev * 2);
setDoubleCount(count() * 2);
});

return (
Expand Down

0 comments on commit d1ec214

Please sign in to comment.