Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/framework/react/guides/custom-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
};
}
Expand Down Expand Up @@ -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,
})
},
}
Expand Down
10 changes: 6 additions & 4 deletions examples/react/custom-devtools/src/counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
},
}
Expand Down
Loading