Toggle

com.alecdorrington.laminarcomponents.Toggle
object Toggle

Something that opens and closes, such as a menu or a popover, folded from every cause of either.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Toggle.type

Members list

Value members

Concrete methods

def apply[A](openings: EventStream[A], closings: EventStream[Any]): Signal[Option[A]]

Folds openings and closings into what is open: an opening's value while closed, and None after a second opening or any closing.

Folds openings and closings into what is open: an opening's value while closed, and None after a second opening or any closing.

Type parameters

A

What an opening opens.

Value parameters

closings

The closings.

openings

The openings, each with what it opens.

Attributes

Returns

What is open, if anything.

def flag(flips: EventStream[Any], closings: EventStream[Any] = ...): Signal[Boolean]

Folds flips and closings into whether something is open.

Folds flips and closings into whether something is open.

Value parameters

closings

The closings.

flips

The flips, each opening it if closed, else closing it.

Attributes

Returns

Whether it is open.