Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek-12 committed Mar 10, 2024
1 parent ab7ec72 commit 8812c4d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@

![badge][badge-android] ![badge][badge-jvm] ![badge][badge-js] ![badge][badge-nodejs] ![badge][badge-linux] ![badge][badge-windows] ![badge][badge-ios] ![badge][badge-mac] ![badge][badge-watchos] ![badge][badge-tvos] ![badge][badge-wasm]

FlowMVI is a Kotlin Multiplatform MVI library based on coroutines that has a few main goals:

1. Being simple to understand and use while staying powerful and flexible.
2. Featuring a clean and rich DSL.
3. Being thread-safe but asynchronous by design.
FlowMVI is a Kotlin Multiplatform architectural framework based on coroutines with an extensive feature set, powerful
plugin system and a rich DSL.

## Quickstart:

Expand All @@ -40,10 +37,8 @@ flowmvi-core = { module = "pro.respawn.flowmvi:core", version.ref = "flowmvi" }
flowmvi-test = { module = "pro.respawn.flowmvi:test", version.ref = "flowmvi" }
# Compose multiplatform
flowmvi-compose = { module = "pro.respawn.flowmvi:compose", version.ref = "flowmvi" }
# Common android
# Android (common + view-based)
flowmvi-android = { module = "pro.respawn.flowmvi:android", version.ref = "flowmvi" }
# View-based android
flowmvi-view = { module = "pro.respawn.flowmvi:android-view", version.ref = "flowmvi" }
# Multiplatform state preservation
flowmvi-savedstate = { module = "pro.respawn.flowmvi:savedstate", version.ref = "flowmvi" }
# Remote debugging client
Expand Down Expand Up @@ -74,7 +69,6 @@ dependencies {
commonTestImplementation("pro.respawn.flowmvi:test:$flowmvi")
// android integration
androidMainImplementation("pro.respawn.flowmvi:android:$flowmvi")
androidMainImplementation("pro.respawn.flowmvi:android-view:$flowmvi")
// remote debugging client
androidDebugImplementation("pro.respawn.flowmvi:debugger-plugin:$flowmvi")
}
Expand All @@ -100,7 +94,7 @@ dependencies {
* Built for Compose: The library lets you achieve the best performance with Compose out of the box.
* The core library depends on kotlin coroutines. Nothing else.
* Integration with popular libraries, such as [Decompose (Essenty)](https://github.com/arkivanov/Decompose)
* 70+% unit test coverage of core library code
* 60+% unit test coverage of core library code

## How does it look?

Expand Down Expand Up @@ -161,7 +155,10 @@ class CounterContainer(
serializer = DisplayingCounter.serializer(),
)

init { repo.startTimer() }
// performs long-running tasks on startup
init {
repo.startTimer()
}

// handles any errors
recover { e: Exception ->
Expand All @@ -178,7 +175,7 @@ class CounterContainer(
}
}

// lazily evaluates and cache values, even when the method is suspending.
// lazily evaluates and caches values, even when the method is suspending.
val pagingData by cache {
repo.getPagedDataSuspending()
}
Expand Down Expand Up @@ -329,9 +326,9 @@ timerPlugin(timer).test(Loading) {
}
```

### Debugger App
## Debugger App

![debugger.gif](docs/images/debugger.gif)
![debugger.gif](docs/images/debugger.gif | width=1280)


Ready to try? Start with reading the [Quickstart Guide](https://opensource.respawn.pro/FlowMVI/#/quickstart).
Expand Down
2 changes: 1 addition & 1 deletion docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ you can just use the defaults. Your devices must be on the same network to conne

Run the server and the app. After a few seconds, your devices should connect and you can start debugging.

![debugger](images/debugger.gif)
![debugger](images/debugger.gif | width=1280)

## Step 3.2 External device configuration

Expand Down
41 changes: 22 additions & 19 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Here's how the library works at a glance:

![Maven Central](https://img.shields.io/maven-central/v/pro.respawn.flowmvi/core?label=Maven%20Central)


<details>
<summary>Version catalogs</summary>

Expand All @@ -18,20 +19,21 @@ Here's how the library works at a glance:
flowmvi = "< Badge above 👆🏻 >"

[dependencies]
# core KMP module
# Core KMP module
flowmvi-core = { module = "pro.respawn.flowmvi:core", version.ref = "flowmvi" }
# test DSL
# Test DSL
flowmvi-test = { module = "pro.respawn.flowmvi:test", version.ref = "flowmvi" }
# compose multiplatform
# Compose multiplatform
flowmvi-compose = { module = "pro.respawn.flowmvi:compose", version.ref = "flowmvi" }
# common android
# Android (common + view-based)
flowmvi-android = { module = "pro.respawn.flowmvi:android", version.ref = "flowmvi" }
# view-based android
flowmvi-view = { module = "pro.respawn.flowmvi:android-view", version.ref = "flowmvi" }
# Multiplatform state preservation
flowmvi-savedstate = { module = "pro.respawn.flowmvi:savedstate", version.ref = "flowmvi" }
# Remote debugging support
flowmvi-debugger = { module = "pro.respawn.flowmvi:debugger-plugin", version.ref = "flowmvi" }
# Remote debugging client
flowmvi-debugger-client = { module = "pro.respawn.flowmvi:debugger-plugin", version.ref = "flowmvi" }
# Essenty (Decompose) integration
flowmvi-essenty = { module = "pro.respawn.flowmvi:essenty", version.ref = "flowmvi" }
flowmvi-essenty-compose = { module = "pro.respawn.flowmvi:essenty-compose", version.ref = "flowmvi" }
```

</details>
Expand All @@ -42,13 +44,20 @@ flowmvi-debugger = { module = "pro.respawn.flowmvi:debugger-plugin", version.ref
```kotlin
dependencies {
val flowmvi = "< Badge above 👆🏻 >"
// Core KMP module
commonMainImplementation("pro.respawn.flowmvi:core:$flowmvi")
// compose multiplatform
commonMainImplementation("pro.respawn.flowmvi:compose:$flowmvi")
// saving and restoring state
commonMainImplementation("pro.respawn.flowmvi:savedstate:$flowmvi")
// essenty integration
commonMainImplementation("pro.respawn.flowmvi:essenty:$flowmvi")
commonMainImplementation("pro.respawn.flowmvi:essenty-compose:$flowmvi")
// testing DSL
commonTestImplementation("pro.respawn.flowmvi:test:$flowmvi")

// android integration
androidMainImplementation("pro.respawn.flowmvi:android:$flowmvi")
androidMainImplementation("pro.respawn.flowmvi:android-view:$flowmvi")
// remote debugging client
androidDebugImplementation("pro.respawn.flowmvi:debugger-plugin:$flowmvi")
}
```
Expand All @@ -60,7 +69,7 @@ dependencies {
<details>
<summary>Configure JDK</summary>

The library's minimum JVM target is set to 11 (sadly still not the default).
The library's minimum JVM target is set to 11 (sadly still not the default in Gradle).
If you encounter an error:

```
Expand Down Expand Up @@ -291,7 +300,7 @@ Some interesting properties of the store:
* Store can be launched, stopped, and relaunched again as many times as you want.
Use `close()`, or cancel the job returned from `start()` to stop the store.
* Store's subscribers will **not** wait until the store is launched when they subscribe to the store.
Such subscribers will not receive state updates or actions. Don't forget to launch the store.
Such subscribers will not receive state updates or actions. Don't forget to start the store.
* Stores are created eagerly usually, but the store *can* be lazy. There is `lazyStore()` for that.

## Step 5: Install plugins
Expand Down Expand Up @@ -391,7 +400,7 @@ You'll likely want to provide some dependencies for the store to use and to crea
putting all code into the store's builder.

The best way to do this is to create a class that acts as a simple wrapper for your store. By convention, it can
usually be called `Container`[^1]. Feel free to not use the provided interface, its only purpose is to act as a marker.
usually be called `Container`. Feel free to not use the provided interface, its only purpose is to act as a marker.

```kotlin
private typealias Ctx = PipelineContext<CounterState, CounterIntent, CounterAction>
Expand Down Expand Up @@ -467,9 +476,3 @@ To subscribe to the store, regardless of your platform see [this guide](android.
* Want more samples? Explore how we created
a [multiplatform debugger app](https://github.com/respawn-app/FlowMVI/tree/34236773e21e7138a330d7d0fb6c5d0eba21b61e/debugger/server/src/commonMain/kotlin/pro/respawn/flowmvi/debugger/server)
for FlowMVI using... FlowMVI itself.

---

[^1]: Although container is a slightly different concept usually, we don't have this kind of separation and we use the
name "store" for our business logic unit already, so the name was "free" to define what it will mean for
FlowMVI

0 comments on commit 8812c4d

Please sign in to comment.