# `Plushie.Event.EffectEvent`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/event/effect_event.ex#L1)

Platform effect responses (file dialogs, clipboard, notifications).

Returned asynchronously after a platform effect command completes.
The `tag` identifies which effect this response belongs to; it
matches the tag you provided when creating the effect command.

## Fields

  * `tag` - the atom tag from the originating effect command
  * `result` - a typed `Plushie.Effect.Result.*` struct
    (e.g. `%FileOpened{path: ...}`, `%Cancelled{}`,
    `%Timeout{}`, `%Error{message: ...}`)

See `Plushie.Effect.Result` for the full variant list.

## Pattern matching

    alias Plushie.Effect.Result

    def update(model, %EffectEvent{tag: :open, result: %Result.FileOpened{path: path}}) do
      load_file(model, path)
    end

    def update(model, %EffectEvent{tag: :open, result: %Result.Cancelled{}}) do
      model
    end

    def update(model, %EffectEvent{result: %Result.Error{message: msg}}) do
      show_error(model, msg)
    end

# `t`

```elixir
@type t() :: %Plushie.Event.EffectEvent{
  result: Plushie.Effect.Result.t(),
  tag: atom()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
