sealed
trait
ZState[S] extends AnyRef
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
ZState[S]models a value of typeSthat can be read from and written to during the execution of an effect. The idiomatic way to work withZStateis as part of the environment using operators defined onZIO. For example:Because
ZStateis typically used as part of the environment, it is recommended to define your own state typeSsuch asMyStateabove rather than using a type such asIntto avoid the risk of ambiguity.To run an effect that depends on some state, create the initial state with the
makeconstructor and then usetoLayerto convert it into a layer that you can provide along with your application's other dependencies.