apps/docs/src/guide/transactions/optimizing-frontend-apps.md
Your application must perform a series of operations to estimate, submit and receive the result of a transaction. However, the flow in which it performs these actions can be organized or performed optimistically, increasing it's perceived speed.
In a frontend application, imagine we have a button that executes a contract call:
<Button onClick={handleSubmit}>Submit</Button>
The handler would be implemented as follows:
<<< @./snippets/transaction-speed/transaction-speed-init.ts#main{ts:line-numbers}
Once the user clicks the button, multiple sequential calls are made to the network, which can take a while because the transaction must be:
With a few optimizations, the flow can be organized as follows:
<<< @./snippets/transaction-speed/transaction-speed-optimized.ts#main{ts:line-numbers}
Finally, when users click the button, they only need to submit the transaction, which vastly improves the perceived speed of the transaction because many of the necessary requests were done upfront, under the hood.
Just remember: