MishkaGervaz.Form.Entities.Events (MishkaGervaz v0.0.1-alpha.3)

Copy Markdown View Source

Event-handler module overrides — replace the default event-handling pipeline (or any sub-handler) with your own implementations.

Two calling styles. Pass a module positionally to override the entire events handler, or use the block form to swap individual sub-handlers while keeping the defaults for the rest:

# Whole-module override
events MyApp.Form.CustomEvents

# Per-sub-handler overrides
events do
  sanitization MyApp.Form.Events.SanitizationHandler
  validation MyApp.Form.Events.ValidationHandler
  submit MyApp.Form.Events.SubmitHandler
  step MyApp.Form.Events.StepHandler
  upload MyApp.Form.Events.UploadHandler
  relation MyApp.Form.Events.RelationHandler
  hooks MyApp.Form.Events.HookRunner
end

Defaults

When no overrides are specified, the following defaults are used:

  • sanitizationMishkaGervaz.Form.Web.Events.SanitizationHandler.Default
  • validationMishkaGervaz.Form.Web.Events.ValidationHandler.Default
  • submitMishkaGervaz.Form.Web.Events.SubmitHandler.Default
  • stepMishkaGervaz.Form.Web.Events.StepHandler.Default
  • uploadMishkaGervaz.Form.Web.Events.UploadHandler.Default
  • relationMishkaGervaz.Form.Web.Events.RelationHandler.Default
  • hooksMishkaGervaz.Form.Web.Events.HookRunner.Default

See MishkaGervaz.Form.Dsl.Events for the DSL declaration.

Summary

Functions

Transform the events after DSL compilation.

Types

t()

@type t() :: %MishkaGervaz.Form.Entities.Events{
  __spark_metadata__: map() | nil,
  hooks: module() | nil,
  module: module() | nil,
  relation: module() | nil,
  sanitization: module() | nil,
  step: module() | nil,
  submit: module() | nil,
  upload: module() | nil,
  validation: module() | nil
}

Functions

transform(events)

Transform the events after DSL compilation.