Skip to content

Commit

Permalink
Update docs and javascript to use inputs instead of mutationFlows
Browse files Browse the repository at this point in the history
  • Loading branch information
dturner committed Feb 14, 2024
1 parent 40ff140 commit 81f8e9b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private val twoCode = """
fun <State: Any> CoroutineScope.stateFlowProducer(
initialState: State,
started: SharingStarted = SharingStarted.WhileSubscribed(),
mutationFlows: List<Flow<Mutation<State>>>
inputs: List<Flow<Mutation<State>>>
) : StateFlowProducer<State>
""".trimIndent()

Expand All @@ -63,7 +63,7 @@ class Snail7StateHolder(
private val stateProducer = scope.stateFlowProducer(
initialState = Snail7State(),
started = SharingStarted.WhileSubscribed(),
mutationFlows = listOf(
inputs = listOf(
speedChanges,
progressChanges,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class Snail11StateHolder(
private val mutator = scope.actionStateFlowProducer<Action, Snail11State>(
initialState = Snail11State(),
started = SharingStarted.WhileSubscribed(),
mutationFlows = listOf(
inputs = listOf(
speedChanges,
progressChanges
),
Expand Down Expand Up @@ -239,7 +239,7 @@ private val nineMarkdown = """
In the above, all there are two sources of state `Mutation`s:
* Data sources in the `mutationFlows` argument; defined as `Flow<Mutation<State>>`
* Data sources in the `inputs` argument; defined as `Flow<Mutation<State>>`
* User events in the `actionTransform` argument; defined as `(Flow<Action>) -> Flow<Mutation<State>>`
Crucially the `actionTransform` takes a `Flow` of all `Action` instances, splits them out into individual `Flow`s for each `Action`, and finally applies `Flow` transformations to each `Action` `Flow` to turn them into `Flow<Mutation<State>>`:
Expand Down
2 changes: 1 addition & 1 deletion docs/demo.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/demo.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SnailStateHolder(
private val stateProducer = scope.stateFlowProducer(
initialState = Snail7State(),
started = SharingStarted.WhileSubscribed(),
mutationFlows = listOf(
inputs = listOf(
speedChanges,
progressChanges,
)
Expand Down

0 comments on commit 81f8e9b

Please sign in to comment.