Skip to main content Link Search Menu Expand Document (external link)

The Store Registry

Durable and isolated storage in Jancy is implemented via the Store Registry.

There is only one store registry and it can always be found at jancy.storeRegistry.

Methods

storeRegistry.getItem(namespace, key)

  • namespace (string)
  • key (string)

Returns the value assoicated with key in the storage associated with namespace.

storeRegistry.getKeys(namespace, key)

  • namespace (string)
  • filter ([string])

A generator for getting all the keys from a store identified by namespace. Accepts an optional filter which is an array of strings that represent keys you don’t want returned.

Each generated item will be an object that has the following properties:

  • key (string)
  • data (string)

storeRegistry.removeItem(namespace, key)

  • namespace (string)
  • key (string)

Removes the key and the value from the storage associated with namespace.

storeRegistry.setItem(namespace, key, value)

  • namespace (string)
  • key (string)
  • value (Any)

Sets the value of key to value in the storage associated with namespace.

storeRegistry.testItem(namespace, key, value)

  • namespace (string)
  • key (string)
  • value (Any)

Sets the current value of key in namespace to value if key is not set.