scalm
package scalm
Scalm is a user interface library inspired by Elm.
- Alphabetic
- By Inheritance
- scalm
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
App extends Component
An application is a component with an initialization operation
-
sealed
trait
Attr[+M] extends AnyRef
HTML attribute
-
case class
Attribute(name: String, value: String) extends Attr[Nothing] with Product with Serializable
Attribute of an HTML tag
-
sealed
trait
Cmd[+Msg] extends AnyRef
A command describes some side-effect to perform.
A command describes some side-effect to perform.
The difference with a
Task
is that a command never produces error values. -
trait
Component extends AnyRef
A component is a typical structure that emerges from your code when you start modularizing it.
A component is a typical structure that emerges from your code when you start modularizing it. You don’t *have to* break down your code into components, but sometimes you do and this class is useful to abstract over them.
A component defines how to maintain and render a state.
In the case of a counter, for instance, the state would be just an
Int
, and the component would to react to anIncrement
message to increment the current state. -
sealed
trait
Elem[+M] extends AnyRef
An HTML element can be a tag or a text node
-
case class
Event[E <: org.scalajs.dom.Event, M](name: String, msg: (E) ⇒ M) extends Attr[M] with Product with Serializable
Event handler
Event handler
- name
Event name (e.g.
"click"
)- msg
Message to produce when the event is triggered
-
case class
Hook[Model](model: Model, renderer: HookRenderer[Model]) extends Html[Nothing] with Product with Serializable
Unmanaged HTML tag
Unmanaged HTML tag
- model
current state to render
- renderer
function that renders the given model
- trait HookRenderer[Model] extends AnyRef
-
sealed
trait
Html[+M] extends Elem[M]
Base class for HTML tags
-
case class
Prop(name: String, value: String) extends Attr[Nothing] with Product with Serializable
Property of a DOM node instance
-
trait
Scalm extends SnabbdomSyntax
Scalm runtime implementation
- case class Style extends Product with Serializable
-
sealed
trait
Sub[+Msg] extends AnyRef
A subscription describes a resource that an application is interested in.
A subscription describes a resource that an application is interested in.
Examples:
- a timeout notifies its subscribers when it expires, - a video being played notifies its subscribers with subtitles.
- Msg
Type of message produced by the resource
-
case class
Tag[+M](name: String, attrs: Seq[Attr[M]], children: Seq[Elem[M]]) extends Html[M] with Product with Serializable
An HTML tag
-
sealed
trait
Task[+Err, +Success] extends AnyRef
A task describes some side-effect to perform.
A task describes some side-effect to perform.
Examples:
- An XHR
- Err
Type of error produced the task
- Success
Type of successful value produced by the task
-
case class
Text(value: String) extends Elem[Nothing] with Product with Serializable
A text node