Plugins are functions that are called at specific points in the Store lifecycle. They can be used to add additional functionality to the Store.Documentation Index
Fetch the complete documentation index at: https://docs.hana.leafphp.dev/llms.txt
Use this file to discover all available pages before exploring further.
Creating a Plugin#
A plugin is basically a class that implements thePlugin interface. This interface contains the following methods:
onReady(): Called when the Store is ready.onSave(): Called when a value is saved or updated in the Store.onRead(): Called when a value is read from the Store.onReducerInvoke(): Called when a reducer is called.onReset(): Called when the Store is reset.
Using a Plugin#
To use a plugin, you need to pass it to thecreateStore() function as part of the configuration object. This object takes in a plugins property which is an array of plugins to use with the Store.
createStore() function.

