Skip to content

WatchProperty

interface WatchProperty
Package: dev.joid.lib.ui.node.property · Module: core · Source: WatchProperty.java

Action that Node.watch(...) runs on its node each time the watched signal changes.

Pass one or more to Node.watch: watch(items, WatchProperty.CLEAR_CHILDREN, WatchProperty.BODY) removes the children, then runs the body again, so the node rebuilds its subtree from the current value. A lambda (node, signal) -> ... gives an action of your own. When an action throws, JOID prints a warning and the other actions of the watch still run.

ReturnsSignatureSummary
voidapply(Node node, Signal<?> signal) abstractRuns the action on node after signal changed, on the render thread, while JOID follows the reads like in a body.
TypeNameValueSummary
WatchPropertyBODYRuns the body that the node received with body(...) again; it does nothing on a node without body.
WatchPropertyCLEAR_CHILDREN(node, signal) -> node.clearChildren()Removes every child of the node.

void apply(Node node, Signal<?> signal) abstract

Runs the action on node after signal changed, on the render thread, while JOID follows the reads like in a body.

WatchProperty BODY

Runs the body that the node received with body(...) again; it does nothing on a node without body. It does not remove the children that the previous body added: put CLEAR_CHILDREN before it.

WatchProperty CLEAR_CHILDREN

Removes every child of the node.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page