StateSnapshotF

final class StateSnapshotF[F[_], A[_], S](val value: S, val underlyingSetFn: Reusable[F => S], val reusability: Reusability[S])(implicit FF: UnsafeSync[F], AA: Async[A]) extends Write[F, A, S]
Companion:
object
trait Write[F, A, S]
trait ModState[F, A, S]
trait SetState[F, A, S]
trait Base[F, A]
class Object
trait Matchable
class Any

Type members

Types

override type WithAsyncEffect[G[_]] = StateSnapshotF[F, G, S]
override type WithEffect[G[_]] = StateSnapshotF[G, A, S]

Value members

Concrete methods

override def modStateOption[G[_]](mod: S => Option[S], callback: => G[Unit])(implicit G: Dispatch[G]): F[Unit]
Value parameters:
callback

Executed regardless of whether state is changed.

Definition Classes
ModState
def narrowOption[T <: S : ClassTag]: Option[StateSnapshotF[F, A, T]]
Returns:

None if value: S isn't value: T as well.

override def setStateOption[G[_]](newState: Option[S], callback: => G[Unit])(implicit G: Dispatch[G]): F[Unit]
Value parameters:
callback

Executed regardless of whether state is changed.

Definition Classes
SetState
override def toString: String
Definition Classes
Any
def unsafeWiden[T >: S](implicit ct: ClassTag[S]): StateSnapshotF[F, A, T]

Unsafe because writes may be dropped.

Unsafe because writes may be dropped.

Eg. if you widen a StateSnapshot[Banana] into StateSnapshot[Food], calling setState(banana2) will work but setState(pasta) will be silently ignored.

override def withAsyncEffect[G[_]](implicit G: Async[G]): WithAsyncEffect[G]
Definition Classes
Base
override def withEffect[G[_]](implicit G: UnsafeSync[G]): WithEffect[G]
Definition Classes
Base
def withValue(s: S): StateSnapshotF[F, A, S]

THIS WILL VOID REUSABILITY.

THIS WILL VOID REUSABILITY.

The resulting StateSnapshotF[F, A, S] will not be reusable.

def xmapState[T](f: S => T)(g: T => S): StateSnapshotF[F, A, T]

THIS WILL VOID REUSABILITY.

THIS WILL VOID REUSABILITY.

The resulting StateSnapshot[T] will not be reusable.

def zoomState[T](f: S => T)(g: T => S => S): StateSnapshotF[F, A, T]

THIS WILL VOID REUSABILITY.

THIS WILL VOID REUSABILITY.

The resulting StateSnapshot[T] will not be reusable.

def zoomStateOption[T](f: S => Option[T])(g: T => S => S): Option[StateSnapshotF[F, A, T]]

THIS WILL VOID REUSABILITY.

THIS WILL VOID REUSABILITY.

The resulting StateSnapshot[T] will not be reusable.

Inherited methods

final protected def async(f: Function0[Unit] => F[Unit]): A[Unit]
Inherited from:
Base
def modState[G[_]](mod: S => S, callback: => G[Unit])(implicit G: Dispatch[G]): F[Unit]
Value parameters:
callback

Executed after state is changed.

Inherited from:
ModState
final def modState(mod: S => S): F[Unit]
Inherited from:
ModState
final def modStateAsync(mod: S => S): A[Unit]
Inherited from:
ModState
final def modStateOption(mod: S => Option[S]): F[Unit]
Inherited from:
ModState
final def modStateOptionAsync(mod: S => Option[S]): A[Unit]
Inherited from:
ModState
def setState[G[_]](newState: S, callback: => G[Unit])(implicit G: Dispatch[G]): F[Unit]
Value parameters:
callback

Executed after state is changed.

Inherited from:
SetState
final def setState(newState: S): F[Unit]
Inherited from:
SetState
final def setStateAsync(newState: S): A[Unit]
Inherited from:
SetState
final def setStateOption(newState: Option[S]): F[Unit]
Inherited from:
SetState
final def setStateOptionAsync(newState: Option[S]): A[Unit]
Inherited from:
SetState
def toModStateFn: ModStateFn[F, A, S]
Inherited from:
ModState
def toSetStateFn: SetStateFn[F, A, S]
Inherited from:
SetState
Inherited from:
Base
final def withEffectsPure: WithEffect[Sync]
Inherited from:
Base

Concrete fields

val underlyingSetFn: Reusable[F => S]
val value: S