Skip to content

Commit

Permalink
utility method
Browse files Browse the repository at this point in the history
  • Loading branch information
edgao committed Feb 15, 2024
1 parent f1c22a0 commit 67f0f17
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,14 @@ interface Migration<State> {
*/
fun migrateIfNecessary(state: State, stream: StreamConfig): MigrationResult<State>

data class MigrationResult<State>(val updatedState: State, val softReset: Boolean)
data class MigrationResult<State>(val updatedState: State, val softReset: Boolean) {
companion object {
/**
* If a migration detects no need to migrate, it should return this.
*/
fun <State> noop(updatedState: State): MigrationResult<State> {
return MigrationResult(updatedState, false)
}
}
}
}

0 comments on commit 67f0f17

Please sign in to comment.