trackRunAndCommit

fun <T : PotentiallyPartialResult, F : TreeFuture<T>> trackRunAndCommit(treeFuture: F, futureList: MutableList<F>, source: Int, mutex: Any, futureExecutionListener: TreeFuture.FutureExecutionListener?, scope: InitialStateScope, viewModelStore: LithoViewModelStore?, onResult: (T) -> Unit): TreeFuture.TreeFutureResult<T>

Wraps compute (via trackAndRunTreeFuture) and commit into a single operation.

Return

The result holder from running the future

Parameters

treeFuture

The future to execute

futureList

The list of futures for dedup/reuse

source

The calculation source

mutex

Synchronization lock for the future list

futureExecutionListener

Optional listener

scope

The InitialStateScope to close after compute and commit

viewModelStore

An optional store retained while the calculation runs

onResult

Called with the non-null result to perform commit logic