Skip to content

Commit

Permalink
link pollingInterval and mention scaffold.config.ts for eventSubscrib…
Browse files Browse the repository at this point in the history
…er hook
  • Loading branch information
technophile-04 committed Nov 20, 2023
1 parent 4f72c82 commit 1314b2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/hooks/useScaffoldEventHistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ const {
});
```

This example retrieves the historical event logs for the `GreetingChange` event of the `YourContract` smart contract, starting from block number 31231 and filtering events where the premium parameter is true. The data property of the returned object contains an array of event objects, each containing the event parameters and (optionally) the block, transaction, and receipt data. The `isLoading` property indicates whether the event logs are currently being fetched, and the `error` property contains any error that occurred during the fetching process (if applicable). Since `watch` is set to true, the event logs will be refetched every `pollingInterval` milliseconds (set at scaffoldConfig.config.ts).
This example retrieves the historical event logs for the `GreetingChange` event of the `YourContract` smart contract, starting from block number 31231 and filtering events where the premium parameter is true. The data property of the returned object contains an array of event objects, each containing the event parameters and (optionally) the block, transaction, and receipt data. The `isLoading` property indicates whether the event logs are currently being fetched, and the `error` property contains any error that occurred during the fetching process (if applicable). Since `watch` is set to true, the event logs will be refetched every [`pollingInterval`](/deploying/deploy-nextjs-app#--pollinginterval) (set at `scaffold.config.ts`).
2 changes: 1 addition & 1 deletion docs/hooks/useScaffoldEventSubscriber.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ useScaffoldEventSubscriber({
});
```

This example subscribes to the `GreetingChange` event emitted by the `YourContract` smart contract and logs the parameters from the event to the console when it's emitted. The `listener` function accepts an array of `logs` that occurred during the [ `pollingInterval`](/deploying/deploy-nextjs-app#--pollinginterval) and each array items contains an `args` property which can be destructured to get the parameters emitted by the event, this function can customized according to your needs.
This example subscribes to the `GreetingChange` event emitted by the `YourContract` smart contract and logs the parameters from the event to the console when it's emitted. The `listener` function accepts an array of `logs` that occurred during the [`pollingInterval`](/deploying/deploy-nextjs-app#--pollinginterval) (set at `scaffold.config.ts`) and each array items contains an `args` property which can be destructured to get the parameters emitted by the event, this function can customized according to your needs.

:::note

Expand Down

0 comments on commit 1314b2a

Please sign in to comment.