Called when data was changed (before comitting).
Called after modified data was written to storage.
Called when new data arrives from storage, while local data is still uncommitted.
Return false to prevent updating the local data with the new storage content.
Called on errors, e.g. when Ajax requests fails.
Called after data was received from remote service.
Called after modified data was POSTed to remote
.
Modified data was stored.
If remote
was passed, this means push
has finished,
otherwise commit
has finished.
Status changed.
Possible values: 'ok', 'error', 'loading', 'status', 'modified'.
Called after data was loaded from local storage.
Track form input changes and maintain persisto-STATUS
class names.
persisto
to form.persisto-STATUS
class to form.Commit changes after X milliseconds of inactivity.
Commit cached changes to localStorage after 0.5 seconds of inactivity.
After each change, we wait 0.5 more seconds for additional changes to come
in, before the actual commit is executed.
The maximum delay (first change until actual commit) is limited by maxCommitDelay.
Set to 0
to force synchronous mode.
Default: 500
milliseconds.
Allow PersistentObject.set to create missing intermediate parent objects.
Verbosity level: 0:quiet, 1:normal, 2:verbose.
Default: 1
Default values if no data is found in localStorage.
Default: {}
.
Commit changes max. X millseconds after first change.
This settings limits the effect of commitDelay, which would otherwise never commit if the user enters keystrokes frequently.
Default: 3000
milliseconds
Push commits max. X milliseconds after first change.
Push every commit to remote max. 30 seconds after it occurred. This setting limits the effect of pushDelay.
Default: 30000
milliseconds.
Push commits after X milliseconds of inactivity.
Push commits to remote after 5 seconds of inactivity.
After each change, we wait 5 more seconds for additional changes to come
in, before the actual push is executed.
The maximum delay (first change until actual push) is limited by maxPushDelay.
Set to 0
to force synchronous mode.
Default: 5000
milliseconds
URL for GET/PUT request to remote server.
Pass null
to disable remote synchronization.
Default: null
.
Set persisto-STATUS
classes here.
Instance of Web Storage.
Possible values are window.localStorage
, window.sessionStorage
.
Pass null
to disable persistence.
Default: window.localStorage
Generated using TypeDoc
Available options for PersistentObject.
Options are passed to the constructor as plain object:
Events may be handled by passing a handler callback option: