File tree 4 files changed +5
-4
lines changed
4 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ can be configured with `EventRecordingArguments` properties.
42
42
43
43
``` kotlin
44
44
val machine = createStateMachine(
45
- creationArguments = CreationArguments ( eventRecordingArguments = EventRecordingArguments ())
45
+ creationArguments = buildCreationArguments { eventRecordingArguments = buildEventRecordingArguments {} }
46
46
) {
47
47
// ...
48
48
}
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ val machine = createStateMachine(
32
32
```
33
33
34
34
By default, factory functions start state machine. You can control it using ` start ` argument.
35
- All overloads accept optional argument ` CreationArguments ` which allows to change some options.
35
+ All overloads accept optional argument ` CreationArguments ` which allows to change some options.
36
+ Use ` buildCreationArguments() ` function to provide it.
36
37
37
38
Subsequent samples will use ` createStateMachine() ` function, but you can choose that one which fits your needs.
38
39
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ block to have a valid state references for transitions.
269
269
Keep in mind that states are mutated by machine instance, defining them with `object ` keyword (i.e. singleton) often
270
270
makes your states live longer than machine. It is common use case when you have multiple similar machines
271
271
that are using same singleton states sequentially. Library detects such cases automatically by default
272
- (see `autoDestroyOnStatesReuse` argument of `CreationArguments ` structure ) and cleans states allowing for future reuse.
272
+ (see `autoDestroyOnStatesReuse` property of `CreationArguments ` interface ) and cleans states allowing for future reuse.
273
273
You can disable automatic machine destruction on state reuse, and call `StateMachine .destroy()` manually if required,
274
274
or just do not use `object ` keyword for defining states.
275
275
If you have your own `DefaultState ` subclasses that are singletons and has data fields, use
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ to previous state (except target-less transitions).
256
256
This API might be called as many times as needed.
257
257
To implement this feature library stores transitions in a stack, it takes memory,
258
258
so this feature is disabled by default and must be enabled explicitly using
259
- ` createStateMachine(creationArguments = CreationArguments( isUndoEnabled = true) ) ` argument.
259
+ ` createStateMachine(creationArguments = buildCreationArguments { isUndoEnabled = true } ) ` argument.
260
260
Other words this feature works like stack based FSM.
261
261
262
262
Undo functionality is implemented as ` Event ` , so it possible to call ` undo() ` from notification callbacks, if you use
You can’t perform that action at this time.
0 commit comments