commonMain.com.copperleaf.ballast.undo.UndoScopeImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ballast-undo-jvm Show documentation
Show all versions of ballast-undo-jvm Show documentation
Adds undo/redo functionality to your ViewModel state.
package com.copperleaf.ballast.undo
import com.copperleaf.ballast.BallastInterceptorScope
import com.copperleaf.ballast.Queued
import kotlinx.coroutines.CoroutineScope
public class UndoScopeImpl(
private val interceptorScope: BallastInterceptorScope
) : UndoScope, CoroutineScope by interceptorScope {
public override suspend fun restoreState(state: State) {
interceptorScope.sendToQueue(Queued.RestoreState(null, state))
}
}