You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This replaces all of the previous persistence hash methods with a single
`peristent_data` method. This method both saves to and retrieves from
the persistence hash. The first (or second including self in PGcore)
parameter is the key in the persistence hash. If the optional second
(or third including self in PGcore) parameter is not given then the
value of the key for the given label in the hash will be returned. If
the second parameter is given then the value of the key in the hash will
be saved or updated. Note that if third parameter is given but is
undefined then the key will be deleted from the hash. Anything that can
be JSON encoded can be stored.
Any frontend should save the persistence hash in some way, and send it
back each time the problem is rendered.
The `store_persistent_data`, `update_persistent_data`, and
`get_peristent_data` methods from before still exist in PG.pl (but were
removed from PGcore.pl) and they all just call the new `persistent_data`
method. However, they should be considered deprecated, and are only
left for backwards compatability. Note that the `store_persistent_data`
method no longer warns if one tries to set the data for a key in the
hash that is already set. There was no reason for that warning and
probably is why the `update_persistent_data` method was created that
does exactly the same thing except that it doesn't warn and it doesn't
return the label that was passed in (why do that anyway?). The whole
mechanism was rather poorly designed to begin with.
0 commit comments