b retrieveFunction(b() defn, String(String) retriever, String key)
defn: The default function to call if the state key does not exist.
retriever: A function that returns the encoded state when given the key
key: The key to find the state
In some circumstances you may need to store application state in an external source, so that a user may save their session and return to it later.
This function lets you retrieve a saved state from an external source based on a key.
The function represented by the saved state is then executed. The retrieval function should throw an Exception if it can't find the key, which will cause the default function
defn to be executed instead. Otherwise, it should, given the key, return the state string that was stored using storeFunction.
One use of this is to generate links to be sent via email, where the links generated by Kaya containing the state data itself are too long to be practical.
You should consider when writing the retrieval function whether the action of retrieving the state should delete it from the persistent storage.