Browser

case class Browser(properties: Map[(ElementId, String), String], forms: Map[ElementId, FormData], filesMap: Map[ElementId, Map[String, Array[Byte]]], jsMocks: List[String])
Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def access[F[_] : Effect, S, M](initialState: S, f: Access[F, S, M] => F[Unit], eventData: String, elements: Map[Id, ElementId]): F[Seq[Action[F, S, M]]]

Applies f to the Browser using Context.Access.

Applies f to the Browser using Context.Access.

Value parameters:
elements

evalJs uses this mapping to search elements on the client side.

def event[F[_] : Effect, S, M](state: S, dom: Node[Binding[F, S, M]], event: String, target: PseudoHtml => Option[Id], eventData: String): F[Seq[Action[F, S, M]]]

Simulate event propagation on the given DOM.

Simulate event propagation on the given DOM.

See also:
Example:
def onClick(access: Access) = ???
val dom = body(
 div("Hello world"),
 button(
   event("click")(onClick),
   name := "my-button",
   "Click me"
 )
)
val actions = Browser.event(
 state = myInitialState,
 dom = dom,
 event = "click"
 target = _.byName("by-button").headOption,
)
def file(id: ElementId, file: (String, Array[Byte])): Browser

Add file to id.

Add file to id.

def files(id: ElementId, filesList: (String, Array[Byte])*): Browser

Set files at id to filesList.

Set files at id to filesList.

def form(id: ElementId, data: FormData): Browser
def form(id: ElementId, fields: (String, String)*): Browser
def mockJs(script: String): Browser
def property(id: ElementId, name: String, value: String): Browser
def value(id: ElementId, value: String): Browser

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product