SimpleChain

class SimpleChain<out R>(gen: suspend () -> R) : Chain<R>

A simple chain of independent tokens. fork returns the same chain.

Constructors

Link copied to clipboard
fun <out R> SimpleChain(gen: suspend () -> R)

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<R>)
Link copied to clipboard
open suspend override fun fork(): Chain<R>

Create a copy of current chain state. Consuming resulting chain does not affect initial chain.

Link copied to clipboard
open suspend override fun next(): R

Generate next value, changing state if needed

Sources

Link copied to clipboard