Created
July 3, 2018 12:37
-
-
Save ben-ole/4dfedfc6014020662a3d8604b4de8a1f to your computer and use it in GitHub Desktop.
KaufmannEx EventHandler 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Sample.EventHandler do | |
alias KaufmannEx.Schemas.Event | |
def given_event(%Event{name: :"command.user.create", payload: payload} = event) do | |
{:ok, user_info} = Sample.User.create(payload) | |
Publisher.publish(:"event.user.create", user_info, event.meta) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment