getNumberFlow

fun getNumberFlow(propertyPath: String): Flow<Float>

Creates or retrieves from cache a number property, represented as a cold Flow.

The flow is subscribed to updates from the Rive worker while it is being collected.

This flow emits every distinct value (up to the backing buffer limit). If you process the flow slowly, consider applying conflate if you only need the latest value to skip intermediate values. Alternatively, if you need to process every value, consider using a buffer operator with an appropriate buffer size to handle bursts.

Collection of the flow may cause an exception:

  • RuntimeException: If this class has been closed, if the property does not exist on this view model instance, or is is of a different type.

  • IllegalStateException: If the backing Rive worker has been released.

Return

A cold Flow of Float values representing the property.

Parameters

propertyPath

The path to the property from this view model instance. Slash delimited to refer to nested properties.