The Spark verifier of a presenter definition
It runs one time for each module that uses Expresso.Presenter.Dsl, when the
module compiles. It refuses these errors:
- The option
statedoes not hold exactly the fields ofExpresso.Presenter.Definition, or a value has the wrong type. - The option
sync, the optionresetor the optionmatchof a mode names an unknown field. The optionsyncor the optionresetnamesindex. - Two modes have the same name.
- A command is not a command of
Expresso.Presenter.Definition, or it gives a field a value of the wrong type. - A mode with the option
anyhas bindings. - One event has two bindings in one mode. The list of keys would then show two functions for the event.
- The event
:elementis in a mode without the optionelement. - A projection names an unknown field, or an attribute or a property with
a wrong name.
Expresso.Presenter.Projectiondescribes the projections. An attribute withflag: trueneeds a field that is true or false, and a mark needs a field that holds a number.
The script in the browser reads the same fields and commands. Without the verifier, the script finds such an error only when the presenter uses the document.
Summary
Functions
Make sure of the definition of a presenter
Functions
@spec verify(map()) :: :ok | {:error, Spark.Error.DslError.t()}
Make sure of the definition of a presenter