ComputationWithArgs

Contract for querying computed values with arguments from transformers.

Similar to Computation but allows passing arguments to the computation function. Useful for parameterized queries and calculations.

Parameters

useCache

Whether to cache computation results for improved performance

Example usage:

companion object {
val userByIdContract = Contract.computationWithArgs<String, User?>()
}

// In transformer A
override val computations = computations {
register(userByIdContract) { userId ->
userRepository.findById(userId)
}
}

// In transformer B
val user = compute(userByIdContract, "user123")

Type Parameters

A

The type of arguments passed to the computation

T

The return type of the computation