Skip to content

A simple, yet powerful, State Machine to manage UI complex UI states, written in Kotlin for multiplatform usage!

Notifications You must be signed in to change notification settings

joost-klitsie/StateMachine

Repository files navigation

This is an example project showing off a state machine with a simple UI to show off its capabilities. This is the initial branch, make sure to check out all the other branches as well!

This is the list of articles:

The demo shows that you can control the following flow:

  1. Load form data, first time with an error we have to handle
  2. Manipulate data
  3. Save the data with input validation (not empty)
  4. Show the success screen

Compared to the previous solution, we now rely on side effects to trigger loading/saving, fire events and transition to a new state

This is a Kotlin Multiplatform project targeting Android, Web, Desktop (JVM).

  • /composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:
    • commonMain is for code that’s common for all targets.
    • Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to edit the Desktop (JVM) specific part, the jvmMain folder is the appropriate location.

Learn more about Kotlin Multiplatform, Compose Multiplatform, Kotlin/Wasm

You can open the desktop app with hot reload by hitting the "play" button in the gutter inside desktop's Main.kt file. You can also open the web application by running the :composeApp:wasmJsBrowserDevelopmentRun Gradle task.

About

A simple, yet powerful, State Machine to manage UI complex UI states, written in Kotlin for multiplatform usage!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published