on

fun <T> on(id: SubscriptionId<T>, snapshot: () -> SubscriptionState<T>)

Registers a preview state for the subscription with the specified ID.

Parameters

id

The subscription ID that identifies this subscription

snapshot

A function that provides the subscription state to be returned for this ID


fun <T> on(testTag: SubscriptionTestTag<T>, snapshot: () -> SubscriptionState<T>)

Registers a preview state for the subscription with the specified test tag.

Parameters

testTag

The test tag that identifies this subscription

snapshot

A function that provides the subscription state to be returned for this tag