AutoSave

Wick. AutoSave

Utility class for autosaving projects.

Constructor

new AutoSave()

Source:

Members

(static) AUTOSAVE_DATA_PREFIX :string

Description:
  • The prefix to use for keys to save project autosave data.

Source:

The prefix to use for keys to save project autosave data.

Type:
  • string

(static) AUTOSAVES_LIST_KEY :string

Description:
  • The key used to store the list of autosaved projects.

Source:

The key used to store the list of autosaved projects.

Type:
  • string

Methods

(static) addAutosaveToList(projectData)

Description:
  • Adds autosaved project data to the list of autosaved projects.

Source:
Parameters:
Name Type Description
projectData Object

(static) delete(uuid, callback)

Description:
  • Deletes a project with a given UUID in the autosaves.

Source:
Parameters:
Name Type Description
uuid string

uuid of project ot delete.

callback function

(static) deleteAutosaveData(uuid)

Description:
  • Deletes project data from the autosave system.

Source:
Parameters:
Name Type Description
uuid string

the UUID of the project to delete

(static) generateAutosaveData(project)

Description:
  • Generates an object that is writable to localforage from a project.

Source:
Parameters:
Name Type Description
project Wick.Project

The project to generate data for.

(static) generateProjectFromAutosaveData(autosaveData)

Description:
  • Creates a project from data loaded from the autosave system

Source:
Parameters:
Name Type Description
autosaveData object

An autosave data object, use generateAutosaveData/readAutosaveData to get this object

(static) getAutosavesList(callback)

Description:
  • Get the list of autosaved projects currently in the AutoSave system.

Source:
Parameters:
Name Type Description
callback function

function to be passed object containing all autosaved projects.

(static) load(uuid, callback)

Description:
  • Loads a given project from localforage.

Source:
Parameters:
Name Type Description
uuid string

the UUID of the project to load from the AutoSave system.

callback function

(static) readAutosaveData(uuid)

Description:
  • Load project data from the autosave system.

Source:
Parameters:
Name Type Description
uuid string

the UUID of the project to load

(static) removeAutosaveFromList(uuid)

Description:
  • Removes autosaved project data to the list of autosaved projects.

Source:
Parameters:
Name Type Description
uuid string

(static) save(project)

Description:
  • Saves a given project to localforage.

Source:
Parameters:
Name Type Description
project Wick.Project

the project to store in the AutoSave system.

(static) updateAutosavesList(autosaveList, callback)

Description:
  • Updates the list of autosaved projects currently in the AutoSave system.

Source:
Parameters:
Name Type Description
autosaveList Object

the list of projects

callback function

called when saving is finished

(static) writeAutosaveData(autosaveData)

Description:
  • Save project data into the autosave system.

Source:
Parameters:
Name Type Description
autosaveData Object

Autosave data of a project, use generateAutosaveData to create this object