Skip to main content

AutoSaveOptions

Options for the auto save module.

Properties​

autoSaveHandler()?​

optional autoSaveHandler: (instance) => any

A handler for the auto save operation. You need to provide this or saveUrl if you set autoSave:true.

Parameters​

instance​

VisuallyJsModel

Returns​

any


debounceTimeout?​

optional debounceTimeout: number

A debounce timeout to use when the autoSave functionality is turned on. You can use this to reduce the number of calls to your auto save endpoint.


enabled?​

optional enabled: boolean

Whether or not to automatically save the data when an update to a model object occurs. If you set this then you need to provide saveUrl or autoSaveHandler.


onAfterAutoSave()?​

optional onAfterAutoSave: () => any

A function to run after the auto save has run.

Returns​

any


onAutoSaveError()?​

optional onAutoSaveError: () => any

A function to call when an auto save operation experienced an error.

Returns​

any


onAutoSaveSuccess()?​

optional onAutoSaveSuccess: () => any

A function to call when an auto save operation was successful.

Returns​

any


onBeforeAutoSave()?​

optional onBeforeAutoSave: () => any

A function to run before auto save runs.

Returns​

any


saveHeaders?​

optional saveHeaders: any

A map of HTTP headers to send along with an auto save request.


saveUrl?​

optional saveUrl: string

URL for auto save endpoint.


type?​

optional type: string

Optional type to use for auto save. Defaults to "json", the default input/output format VisuallyJs uses. If you have registered your own exporter you can use this parameter to instruct VisuallyJs to auto save via that exporter.