StorePlugin
A unit that can extend the business logic of the Store. All stores are mostly based on plugins, and their behavior is entirely determined by them.
Plugins can influence subscription, stopping, and all other forms of store behavior. Access the store's context and other functions through the PipelineContext receiver. Plugins are typically made using StorePluginBuilder.
It is not recommended to implement this interface, instead, use one of the plugin builders
Properties
The name of this plugin. The name can be used for logging purposes, but most importantly, to distinguish between different plugins. Name is optional, in which case the plugins will be compared by reference. If you attempt to StoreBuilder.install the same plugin, or different plugins with the same name, multiple times, an exception will be thrown. If you need to have the same plugin installed multiple times, consider giving plugins different names. Plugins that have no name can be installed multiple times, assuming they are different instances of a plugin. Consider the following examples:
Functions
Create the StorePlugin using provided config
A callback that is invoked each time an MVIAction has been sent. This is invoked after the action has been sent, but before the ActionConsumer handles it. This function will always be invoked, even after the action is later dropped because of ActionShareBehavior, and it will be invoked before the ActionReceiver.send returns, if it has been suspended.
A callback that is invoked when Store handles an exception. This is invoked before the exception is rethrown or otherwise processed. This is invoked asynchronously in a background job and after the job that has thrown was cancelled, meaning that some time may pass after the job is cancelled and the exception is handled. Handled exceptions do not result in Store.close.
A callback which is invoked each time an MVIIntent is received and then begun to be processed. This callback is invoked after the intent is sent, sometimes after significant time if the store was stopped or even never if the store's buffer overflows or store is not ever used again.
A callback that is invoked each time the Store.start is called.
A callback to be invoked each time StateReceiver.updateState or StateReceiver.withState is called. This callback is invoked before the state changes, and any plugin can veto (forbid) or modify the state change.
Invoked when Store.close is invoked. This is called after the store is already closed, and you cannot influence the outcome. This is invoked for both exceptional stops and normal stops. Will not be invoked when an Error is thrown
A callback to be executed each time Store.subscribe is called.
A callback to be executed when the subscriber cancels its subscription job (unsubscribes).