View Source LiveViewModel.Event (live_view_model v0.2.0)

Summary

Types

t()

Represents a CustomEvent to be returned from a reply and dispatched on the client.

Types

@type t() :: %LiveViewModel.Event{detail: map(), name: String.t()}

Represents a CustomEvent to be returned from a reply and dispatched on the client.

Fields:

  • name: becomes the name of the CustomEvent to be dispatched
  • detail: becomes the detail property (payload) of the CustomEvent. Not that because events will be serialized as JSON, everything here must implement Jason.Encoder