serializeStatePlugin
An overload of saveStatePlugin that is configured with some default values for convenience.
This overload will save a GZip-compressed JSON (if supported by the platform) of the state value of type T to a platform-dependent place. For example, on native platforms, a File specified by path. On browser platforms, to a local storage.
This will save the state according to the behaviors specified in SaveBehavior.Default.
By default, this will use Dispatchers.Default to save the state (context).
This will only compress the JSON if the platform permits it (Android, JVM). (CompressedFileSaver).
This will reset the state on exceptions in the store (resetOnException).
This will invoke recover if an exception is encountered when saving or restoring the state.
By default this will throw if the state cannot be read or saved (recover).
Deprecated
Please use an overload that explicitly provides a full path
An overload of saveStatePlugin that is configured with some default values for convenience.
This overload will save a GZip-compressed JSON of the state value of type T to a file in the dir directory and named filename with a specified fileExtension.
This will save the state according to the behaviors specified in SaveBehavior.Default.
By default, this will use Dispatchers.Default to save the state (context).
This will only compress the JSON if the platform permits it (Android, JVM). (CompressedFileSaver).
This will reset the state on exceptions in the store (resetOnException).
This will invoke recover if an exception is encountered when saving or restoring the state.