diff --git a/library/src/main/kotlin/com/github/terrakok/cicerone/CommandBuffer.kt b/library/src/main/kotlin/com/github/terrakok/cicerone/CommandBuffer.kt index fa51a85..9cfdc79 100644 --- a/library/src/main/kotlin/com/github/terrakok/cicerone/CommandBuffer.kt +++ b/library/src/main/kotlin/com/github/terrakok/cicerone/CommandBuffer.kt @@ -22,6 +22,10 @@ internal class CommandBuffer : NavigatorHolder { navigator = null } + override fun clearPendingCommands() { + pendingCommands.clear() + } + /** * Passes `commands` to the [Navigator] if it available. * Else puts it to the pending commands queue to pass it later. diff --git a/library/src/main/kotlin/com/github/terrakok/cicerone/NavigatorHolder.kt b/library/src/main/kotlin/com/github/terrakok/cicerone/NavigatorHolder.kt index fa6ed5e..9e6507f 100644 --- a/library/src/main/kotlin/com/github/terrakok/cicerone/NavigatorHolder.kt +++ b/library/src/main/kotlin/com/github/terrakok/cicerone/NavigatorHolder.kt @@ -17,4 +17,9 @@ interface NavigatorHolder { * Remove the current Navigator and stop receive commands. */ fun removeNavigator() + + /** + * Clear pending commands. + */ + fun clearPendingCommands() }