MCPcopy Create free account
hub / github.com/FThompson/FormPersistence.js / saveFormBeforeUnload

Function saveFormBeforeUnload

form-persistence.js:45–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 // If problems persist, we can add listeners on the pagehide event as well.
44 let saveForm = () => save(form, config)
45 let saveFormBeforeUnload = () => {
46 window.removeEventListener('unload', saveForm)
47 saveForm()
48 }
49 window.addEventListener('beforeunload', saveFormBeforeUnload)
50 window.addEventListener('unload', saveForm)
51 if (!config.saveOnSubmit) {

Callers

nothing calls this directly

Calls 1

saveFormFunction · 0.85

Tested by

no test coverage detected