peekOrSeedInitialKStateByHookKey

fun <T> peekOrSeedInitialKStateByHookKey(key: GlobalKey, hookKey: HookKey, deps: Array<*>, initializer: HookInitializer<T>, componentName: String): CachedValue

Looks up the initial value for hookKey in the lookaside cache, with a deps-equivalence guard.

Three-way decision based on what the cache contains:

  • Cached entry exists with deps that match deps: return the cached entry (concurrent-render dedup).

  • Cached entry exists but deps differ: run the initializer and return a fresh CachedValue with the caller's deps; do NOT update the cache (another render owns the cached entry; overwriting would corrupt its useStateWithDeps semantics).

  • No cached entry: run the initializer, seed the cache, return the entry.

Unlike getOrCreateInitialKStateByHookKey, this does not return a full ComponentState<KStateContainer> -- callers wanting to merge into committed state should do so themselves with KStateContainer.withNewStateByHookKey using the returned (value, deps). This avoids the empty-source-map overwrite hazard when the cache has been drained by unregisterStateHandler.