Package-level declarations
Types
A plugin that allows to cache the value of a property, scoping it to the pro.respawn.flowmvi.api.Store's lifecycle. This plugin will clear the value when PipelineContext is canceled and call the init block each time a store is started to initialize it again.
An entity that manages running jobs. Used with jobManagerPlugin and manageJobs. Will cancel and remove all jobs if the parent pro.respawn.flowmvi.api.Store is closed
A class that manages the job that waits for subscribers to appear. This job is set by the awaitSubscribersPlugin when the store is launched. Use await or complete to manage the job. You can only complete the job once per one start of the store.
A plugin that keeps track of changes in the store. It keeps references to last maxStates
(inclusive) states and so on for other properties. Keep a reference to this plugin and use it to enable custom time travel support or validate the store's behavior in tests.
An object that allows to undo and redo any actions happening in the pro.respawn.flowmvi.api.Store. Keep a reference to the object instance to call undo, redo, and invoke. Don't forget to install the corresponding plugin with undoRedoPlugin.
Properties
Default name for the SavedStatePlugin
Default name for reducePlugin. This is hardcoded so that multiple reduce invocations are not allowed w/o explicit consent of the user as most often multiple reducers will conflict with each other. Provide your own name if you want to have multiple reducers.
Functions
Create a new loggingPlugin that prints using android's Log.
Create a new loggingPlugin that prints using android's Log.
Installs a new awaitSubscribersPlugin
Installs a new plugin using manager that will start waiting for new subscribers when the store launches. The plugin will wait for minSubs subscribers for a maximum duration of timeout. If suspendStore is true, then the store will not process any MVIIntents while it waits for subscribers. This plugin starts waiting after plugins installed before have finished their StorePlugin.onStart block. By default, cannot be installed multiple times, but name can be overridden to allow that, provided that you do not reuse the manager.
Creates and installs a new CachedValue, returning a delegate that can be used to get access to the property that was cached. Please consult the documentation of the parent class to understand how to use this plugin.
Converts value to a StorePlugin. Mostly needed when storing a direct reference to the CachedValue out of the store's scope (which is less safe). For all other cases, use cache.
A logging plugin that prints logs to the console using println. Tag is not used except for naming the plugin.
Create a StorePlugin that simply consumes intents and does nothing with them. This is useful when you are using reducePlugin with consume = false
You can add this to the end of your store declaration to consume the remaining unprocessed intents if you are sure that you already handled all of them fully
Installs a new disallowRestartPlugin. Please consult the docs of the parent function to learn more. This plugin can only be installed only once.
Disallow restart plugin will allow the store to be pro.respawn.flowmvi.api.Store.started only once. It will throw on any subsequent invocations of StorePlugin.onStart. You can use this when you are sure that you are not going to restart your store. I.e. you are using the scope with which you launch the store only once, such as viewModelScope on Android.
Install a new loggingPlugin.
Creates a plugin that invokes block after pro.respawn.flowmvi.api.Store.start is called.
Create a new plugin that uses manager to manage jobs. This will cancel and remove all jobs when the parent pro.respawn.flowmvi.api.Store is closed.
Create a new StorePlugin that prints messages using log.
Create and install a new plugin that uses JobManager to manage running jobs. The plugin will cancel all running jobs if the store is closed.
Install a new parentStorePlugin. This overload does not collect the parent store's actions.
Install a new parentStorePlugin.
Creates and installs a new plugin that will subscribe to the parent store at the same time the current store is subscribed to and when minExternalSubscriptions are reached.
An overload of the parentStorePlugin that also consumes its MVIActions. Please see the other overload for more documentation.
Creates a loggingPlugin that is suitable for each targeted platform. This plugin will log to:
Same as JobManager.put.
Same as JobManager.putOrReplace.
A plugin that restores the pro.respawn.flowmvi.api.StateProvider.state using get in StorePlugin.onStart and saves using set asynchronously in StorePlugin.onState. There are platform overloads for this function.
Creates and installs a new savedStatePlugin.
Create a new TimeTravel and installs it. Keep a reference to the returning value to use its properties.
Create a new TimeTravel and installs it. Keep a reference to the object to use its properties.
Install the specified timeTravel as a plugin.
Create and install a new whileSubscribed plugin. See the parent's function docs for more info.
Create a new plugin that invokes block each time the subscriber count reaches minSubscriptions. Nothing is invoked when more subscribers than minSubscriptions appear, however, the block will be invoked again if the subscriber count drops below minSubscriptions and then reaches the new value again. The block will be canceled when the subscription count drops below minSubscriptions.