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 readImage[F[_] : Async, Msg](inputFieldId: String)(resultToMessage: Result[String] => Msg): Cmd[F, Msg]

Reads an input file from an input field as base64 encoded image data

Reads an input file from an input field as base64 encoded image data

Attributes

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

Reads an input file as base64 encoded image data

Reads an input file as base64 encoded image data

Attributes

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

Reads an input file from an input field as plain text

Reads an input file from an input field as plain text

Attributes

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

Reads an input file as plain text

Reads an input file as plain text

Attributes