Skip to content

Commit

Permalink
docs: simplify quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek-12 committed Dec 5, 2024
1 parent fcb8a51 commit d694dbd
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 147 deletions.
26 changes: 25 additions & 1 deletion docs/plugins/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ All stores are mostly based on plugins, and their behavior is entirely determine
too many plugins. The bottleneck will always be the longest chain of callbacks, not the plugin count. If you don't
define a callback, then no CPU time is spent on running it and no memory is allocated.

If you want to install a custom Plugin, use the methods of the Store builder:

```kotlin
override val store = store(Loading) {

// install an existing plugin
install(
analyticsPlugin(),
diScopePlugin(),
// ...
)

// or build on-the-fly
install {
onIntent { intent ->
analytics.logUserAction(intent.name)
}
}
}
```

## Creating an Eager Plugin

Plugins are simply built:
Expand All @@ -22,7 +43,7 @@ val plugin = plugin<ScreenState, ScreenIntent, ScreenAction> {
```

You can generate a new generic plugin using the `fmvip` [IDE Plugin](https://plugins.jetbrains.com/plugin/25766-flowmvi)
shortcut because those type parameters are annoying.
shortcut.

### Lazy Plugins

Expand Down Expand Up @@ -55,6 +76,9 @@ val resetStatePlugin = lazyPlugin<MVIState, MVIIntent, MVIAction> {

## Plugin DSL

Each property of a plugin has a different set of responsibilities and some usage nuances. Here's an explanation of all
of them:

### Name

```kotlin
Expand Down
Loading

0 comments on commit d694dbd

Please sign in to comment.