DOMDataStore

Datastores. DOMDataStore

A general purpose storage that serializes Concepts and Properties into DOM-elements and their attributes and stores them in the document.

For webstrates-based documents this allows synchronizing with other programs across the web as modifications made to the storage structure also make notifications back into the program.

Options

  • storageName - The name of the element to store that data below (Default: "varv-data")
  • storageWebstrate - The name of the webstrate to store the data at (Default: the current webstrate)

Constructor

new DOMDataStore()

Source:

Methods

getConceptInstanceFromConceptElement(conceptElement) → {any}

Description:
  • Lookup concept and uuid from a concept element

Source:
Parameters:
Name Type Description
conceptElement Element
Returns:
Type
any

getPropertyFromDOM(concept, propertyElement, propertyObject) → {any}

Description:
  • Reconstruct a value from DOM

Source:
Parameters:
Name Type Description
concept Concept
propertyElement Element
propertyObject Property
Returns:
Type
any

(async) loadBackingStore() → {undefined}

Description:
  • Loads all concept instances currently registered as backed from serialized state

Source:
Returns:
Type
undefined

synchronizePropertyElementFromDOM(propertyElement)

Description:
  • Takes the element and looks up everything else from that and pushes its state to the concept

Source:
Parameters:
Name Type Description
propertyElement element

The element with the property to push to concept