Handles state persisting.
String identifying persisted state (like in localStorage.setItem(key, …)).
The state to be persisted.
T - The storage state type.
Shouldn't return or resolve returned promise before the state is persisted.
Handles state persisting.