Skip to content

Commit a2835d0

Browse files
authored
docs: Fix count increment and decrement in custom plugins guide (#154)
The previous code was simply incorrect and I removed a typo'd redundant "TanStack" mention.
1 parent 9ba6d2e commit a2835d0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/framework/react/guides/custom-plugins.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,20 @@ export function createCounter() {
8383
getCount: () => count,
8484
increment: () => {
8585
history.push(count)
86+
count++
8687

8788
// The emit eventSuffix must match that of the EventMap defined in eventClient.ts
8889
DevtoolsEventClient.emit('counter-state', {
89-
count: count++,
90+
count: count,
9091
history: history,
9192
})
9293
},
9394
decrement: () => {
9495
history.push(count)
96+
count--
9597

9698
DevtoolsEventClient.emit('counter-state', {
97-
count: count--,
99+
count: count,
98100
history: history,
99101
})
100102
},
@@ -160,7 +162,7 @@ createRoot(document.getElementById('root')!).render(
160162

161163
## Debugging
162164

163-
Both the TansTack `TanStackDevtools` component and the TanStack `EventClient` come with built in debug mode which will log to the console the emitted event as well as the EventClient status.
165+
Both the `TanStackDevtools` component and the TanStack `EventClient` come with built in debug mode which will log to the console the emitted event as well as the EventClient status.
164166

165167
TanStackDevtool's debugging mode can be activated like so:
166168
```tsx

0 commit comments

Comments
 (0)