The type of Snapshot.snapshotId. On most platforms this is a Long but may be a different type if the platform target does not support Long efficiently (such as JavaScript).
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-23 UTC."],[],[],null,["# SnapshotId\n==========\n\nArtifact: [androidx.compose.runtime:runtime](/jetpack/androidx/releases/compose-runtime) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/snapshots/SnapshotId.+class:androidx.compose.runtime.snapshots.SnapshotId)\nCommon/AllAndroid/JVMNative/C/iOSJavaScript\n - Cmn \n\n ```\n class SnapshotId\n ```\n - JS \n\n ```\n actual typealias SnapshotId = Double\n ```\n - android \n N \n JS \n\n ```\n actual typealias SnapshotId = Long\n ```\n\n*** ** * ** ***\n\nThe type of [Snapshot.snapshotId](/reference/kotlin/androidx/compose/runtime/snapshots/Snapshot#snapshotId()). On most platforms this is a [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) but may be a different type if the platform target does not support [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) efficiently (such as JavaScript).\n\nSummary\n-------\n\n| ### Extension functions |\n|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SnapshotId](/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotId)`.`[toInt](/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotId#(androidx.compose.runtime.snapshots.SnapshotId).toInt())`()` | Cmn |\n| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [SnapshotId](/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotId)`.`[toLong](/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotId#(androidx.compose.runtime.snapshots.SnapshotId).toLong())`()` | Cmn |\n\nExtension functions\n-------------------\n\n### toInt\n\nCmn \nArtifact: [androidx.compose.runtime:runtime](/jetpack/androidx/releases/compose-runtime) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/snapshots/SnapshotId.kt+function:toInt) \n\n```\nfun SnapshotId.toInt(): Int\n``` \n\n### toLong\n\nCmn \nArtifact: [androidx.compose.runtime:runtime](/jetpack/androidx/releases/compose-runtime) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/snapshots/SnapshotId.kt+function:toLong) \n\n```\nfun SnapshotId.toLong(): Long\n```"]]