Introduce typed event payload

Open
#64 5 comments 0 reactions 1 assignee View on GitHub

@davydovanton is already working on this.

Since Apr 14, 2018.

Assessment

This issue has not been assessed yet.

Description

enhancement

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.

Dominant language
Ruby
Stars
41
Forks
6
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hanami/events

All issues in hanami/events

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.