
State management library enabling dependency-based state handling with features for creating, collecting, and managing parent-child state relationships. Integrates easily with build systems for seamless setup.
pom.xml
<dependency>
<groupId>net.kigawa</groupId>
<artifactId>hakate</artifactId>
<version>1.0.0</version>
</dependency>build.gradle.kts
implementation("net.kigawa:hakate:1.0.0")new state
val initializer = HakateInitializer()
val dispatcher = initializer.newStateDispatcher()
val state = stateDispatcher.newState("default value")collect state
stateDispatcher.useState {
state.collect {
value = it
isSet = true
}
}child state
stateDispatcher.useState {
val child = state.child { parent, prev: String? ->
return@child "$parent-child"
}
}set state
state.set("new value")pom.xml
<dependency>
<groupId>net.kigawa</groupId>
<artifactId>hakate</artifactId>
<version>1.0.0</version>
</dependency>build.gradle.kts
implementation("net.kigawa:hakate:1.0.0")new state
val initializer = HakateInitializer()
val dispatcher = initializer.newStateDispatcher()
val state = stateDispatcher.newState("default value")collect state
stateDispatcher.useState {
state.collect {
value = it
isSet = true
}
}child state
stateDispatcher.useState {
val child = state.child { parent, prev: String? ->
return@child "$parent-child"
}
}set state
state.set("new value")