diff --git a/docs/framework/react/guides/custom-plugins.md b/docs/framework/react/guides/custom-plugins.md index 71c6183d..37300884 100644 --- a/docs/framework/react/guides/custom-plugins.md +++ b/docs/framework/react/guides/custom-plugins.md @@ -20,12 +20,12 @@ export function createCounter() { return { getCount: () => count, increment: () => { - history.push(count) count++ + history.push(count) }, decrement: () => { - history.push(count) count-- + history.push(count) }, }; } @@ -82,22 +82,22 @@ export function createCounter() { return { getCount: () => count, increment: () => { - history.push(count) count++ + history.push(count) // The emit eventSuffix must match that of the EventMap defined in eventClient.ts DevtoolsEventClient.emit('counter-state', { - count: count, - history: history, + count, + history, }) }, decrement: () => { - history.push(count) count-- + history.push(count) DevtoolsEventClient.emit('counter-state', { - count: count, - history: history, + count, + history, }) }, } diff --git a/examples/react/custom-devtools/src/counter.ts b/examples/react/custom-devtools/src/counter.ts index 2ac0fc1b..9d8db1e0 100644 --- a/examples/react/custom-devtools/src/counter.ts +++ b/examples/react/custom-devtools/src/counter.ts @@ -7,20 +7,22 @@ export function createCounter() { return { getCount: () => count, increment: () => { + count++ history.push(count) // The emit eventSuffix must match that of the EventMap defined in eventClient.ts DevtoolsEventClient.emit('counter-state', { - count: count++, - history: history, + count, + history, }) }, decrement: () => { + count-- history.push(count) DevtoolsEventClient.emit('counter-state', { - count: count--, - history: history, + count, + history, }) }, }