Store

ff4s.Store
See theStore companion object
sealed trait Store[F[_], State, Action]

Attributes

Companion
object
Source
Store.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def cancel(key: String): F[Unit]

See withCancellationKey.

See withCancellationKey.

Attributes

Source
Store.scala
def dispatch(action: Action): F[Unit]

Adds action to the queue of actions to be evaluated.

Adds action to the queue of actions to be evaluated.

Attributes

Source
Store.scala
def runningState(key: String): Signal[F, Boolean]

See withRunningState.

See withRunningState.

Attributes

Source
Store.scala
def state: Signal[F, State]

Holds the current application state.

Holds the current application state.

Attributes

Source
Store.scala
def withCancellationKey(key: String)(fu: F[Unit]): F[Unit]

Wraps fu and makes it cancelable using cancel(key).

Wraps fu and makes it cancelable using cancel(key). Repeated evaluation of the returned effect will cancel previous evaluations. The returned effect runs exactly as long as fu. In particular, withRunningState(...)(withCancellationKey(...)(fu)) has the same semantics as withCancellationKey(...)(withRunningState(...)(fu)).

WARNING: Nested wrapping using the same key more than once results in undefined behavior of the returned effect (fu may or may not run, and a fiber might deadlock).

Attributes

Source
Store.scala
def withRunningState(key: String)(fu: F[Unit]): F[Unit]

Ensures that runningState(key) evaluates to true while fu is running.

Ensures that runningState(key) evaluates to true while fu is running. Useful for things like loading indicators.

Attributes

Source
Store.scala