Function

asContextElement

Return a SnapshotContextElement that will enter this Snapshot whenever the associated coroutine is resumed and leave this snapshot when it suspends.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

asContextElement

Common
public fun Snapshot.asContextElement(): SnapshotContextElement

Return a SnapshotContextElement that will enter this Snapshot whenever the associated coroutine is resumed and leave this snapshot when it suspends. The snapshot still must be disposed separately when it will no longer be used.