Skip to content

Commit

Permalink
docs: minor fixes in Emojimon guide (#2571)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpolarzero authored Mar 29, 2024
1 parent a3c152b commit baf39ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/pages/guides/emojimon/5-a-wild-emojimon-appears.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ Let's also add this to our client code for better optimistic rendering.

<CollapseCode>

```ts filename="packages/client/src/mud/createSystemCalls.ts" {37-41} copy showLineNumbers
```ts filename="packages/client/src/mud/createSystemCalls.ts" {12,37-41} copy showLineNumbers
import { Has, HasValue, getComponentValue, runQuery } from "@latticexyz/recs";
import { singletonEntity } from "@latticexyz/store-sync/recs";
import { uuid } from "@latticexyz/utils";
Expand Down Expand Up @@ -1028,7 +1028,7 @@ export function createSystemCalls(

</CollapseCode>

When you click the button, the `EncounterScreen` creates a pending toast and kicks off the transaction by calling our `throwBall` method above. We use `awaitStreamValue` to ensure the transaction went through and MUD has updated the client component data. After that, we can get the result of the catch attempt and return it so that the `EncounterScreen` can render the proper message in the toast.
When you click the button, the `EncounterScreen` creates a pending toast and kicks off the transaction by calling our `throwBall` method above. We use `waitForTransaction` to ensure the transaction went through and MUD has updated the client component data. After that, we can get the result of the catch attempt and return it so that the `EncounterScreen` can render the proper message in the toast.

## Flee encounters

Expand Down

0 comments on commit baf39ef

Please sign in to comment.