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
Describe the bug
When an event is fired and has two listeners they share a reference to a single instance.
Expected behaviour
Listeners should have separated instance references. The event should only be mutated by middleware. This might be easier to implement for messages as their payload gets serialized.
Maybe we could create a new class that extends Event such as CloneableEvent which will have an abstract method clone () -> CloneableEvent. The programmer still can use unsafe Event, but for libraries (and Exteranto events), CloneableEvent could be used.
The text was updated successfully, but these errors were encountered:
Describe the bug
When an event is fired and has two listeners they share a reference to a single instance.
Expected behaviour
Listeners should have separated instance references. The event should only be mutated by middleware. This might be easier to implement for messages as their payload gets serialized.
Maybe we could create a new class that extends
Event
such asCloneableEvent
which will have an abstract methodclone () -> CloneableEvent
. The programmer still can use unsafeEvent
, but for libraries (and Exteranto events),CloneableEvent
could be used.The text was updated successfully, but these errors were encountered: