HotReload

object HotReload

A very simple mechanism to allow automatic loading and saving of your applications model to local storage. Uses:

  • During development, allows you to carry on where you left off between site rebuilds.
  • Acts as a user session, to remember where a website/app visitor/user was when they left.
class Object
trait Matchable
class Any

Type members

Classlikes

final case class Error(message: String)

Value members

Concrete methods

def bootstrap[F[_] : Async, Model, Msg](key: String, decode: Option[String] => Either[String, Model])(resultToMessage: Either[String, Model] => Msg): Cmd[F, Msg]

Used during init to try and load an existing session

Used during init to try and load an existing session

def snapshot[F[_] : Async, Model](key: String, model: Model, encode: Model => String): Cmd[F, Nothing]

Simple command to store the model. Can be performed on a regular basis if used in combination with a Sub.every subscription.

Simple command to store the model. Can be performed on a regular basis if used in combination with a Sub.every subscription.