Skip to content

Commit

Permalink
chore: Add burst of non-shallow requests
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Sep 13, 2023
1 parent e60e530 commit 3d500de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/demos/server-side-parsing/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ export function ServerSideParsingDemoClient({
</div>
<button onClick={() => setCounter(x => x - 1)}>-</button>
<button onClick={() => setCounter(x => x + 1)}>+</button>
<button
onClick={async () => {
for (let i = 0; i < 10; ++i) {
// await to avoid batching all those changes together
await setCounter(i + 1)
}
}}
>
Burst of 10
</button>
<button onClick={() => setCounter(null)}>Reset</button>
<p>Client side counter: {counter}</p>
<p>
Expand Down

0 comments on commit 3d500de

Please sign in to comment.