hanami / hanami/events

Introduce typed event payload

Open
#64 5 comments 0 reactions 1 assignee Claimed by @davydovanton View on GitHub
enhancement
Dominant language
Ruby
Stars
41
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Hello!

I found interesting example in presentation of Nikita Shilnikov

```
module Events
class PasswordChanged < Dry::Struct
attribute :user_id, Types::UUID
attribute :password, Types::String
end

class EmailChanged < Dry::Struct
attribute :user_id, Types::UUID
attribute :email, Types::String
end

Updated = PasswordChanged | EmailChanged
end
```

What do you think to use Dry::Struct for events?

IMHO it will make an application (where you will use events) more clear, we will see all possible events, and that events will have guaranteed shape.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.