You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9d03039
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: guides/explanations/events.md
-32Lines changed: 0 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,38 +223,6 @@ You request the consistency guarantee, either `:strong` or `:eventual`, when dis
223
223
224
224
An event handler is a `GenServer` process that subscribes to the configured event store. For each event persisted to the store the `handle/2` callback is called, passing the domain event and its metadata.
225
225
226
-
## Upcasting events
227
-
228
-
Commanded supports upcasting of events at runtime using the `Commanded.Event.Upcaster` protocol.
229
-
230
-
By implementing the upcaster protocol you can transform an event before it is used by a consumer. This might be an aggregate or an event handler. Because the upcaster changes the event at runtime, handlers only need to support the latest version. You can also use upcasting to change the type of event.
231
-
232
-
### Examples
233
-
234
-
Change the shape of an event by renaming a field:
235
-
236
-
```elixir
237
-
defimplCommanded.Event.Upcaster, for: AnEventdo
238
-
defupcast(%AnEvent{} = event, _metadata) do
239
-
%AnEvent{name: name} = event
240
-
241
-
%AnEvent{event |first_name: name}
242
-
end
243
-
end
244
-
```
245
-
246
-
Change the type of event by replacing a historical event with a new event:
- Removed `Commanded.Event.Upcast` and `Commanded.Event.Upcaster` modules
34
+
- Removed upcasting from event handlers and aggregates
35
+
- Removed upcasting documentation
36
+
37
+
**Reason:** Event schema transformations can be handled explicitly in event handlers and aggregates using pattern matching, eliminating the need for a global upcasting component.
0 commit comments