FileReader

tyrian.cmds.FileReader$
object FileReader

Given the id of a file input field that has had a file selected, this Cmd will read either an image or text file to return an HTMLImageElement or String respectively.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
FileReader.type

Members list

Type members

Classlikes

enum Result[A]

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def read[F[_] : Async, Msg](fileInputFieldId: String)(resultToMessage: Result[Any] => Msg): Cmd[F, Msg]

Generic read function, you will need to cast the result to the type you're expecting. This is normal, and is because we are accessing unknown resources.

Generic read function, you will need to cast the result to the type you're expecting. This is normal, and is because we are accessing unknown resources.

Attributes

def readImage[F[_] : Async, Msg](inputFieldId: String)(resultToMessage: Result[Image] => Msg): Cmd[F, Msg]

Reads an input file as an image

Reads an input file as an image

Attributes

def readText[F[_] : Async, Msg](inputFieldId: String)(resultToMessage: Result[String] => Msg): Cmd[F, Msg]

Reads an input file as plain text

Reads an input file as plain text

Attributes