Skip to content

Commit

Permalink
Typed signatures for event handlers.
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Patrin <ppatrin@nvidia.com>
  • Loading branch information
pavelpatrin committed Aug 5, 2024
1 parent 5dce9fa commit 1eb8bf2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ To subscribe to an event, use the `Subscribe()` method. You can pass various typ
// Handle the event with specific args.
})
```
The **number of arguments** in the event and the handler can differ because handlers are designed to be flexible and can process varying numbers and types of arguments, allowing for greater versatility in handling different event scenarios.
- The **number of arguments** in the event and the handler can differ because handlers are designed to be flexible and can process varying numbers and types of arguments, allowing for greater versatility in handling different event scenarios.
- The **types of arguments** in the event and the handler must be assignable. Otherwise, an error will be returned from a `Trigger()` call.

Every handler function could return an `error` which will be joined and returned from `Trigger()` call.

Expand Down

0 comments on commit 1eb8bf2

Please sign in to comment.