module:store/String

module:store/String

String is a resource for handling simple strings of data.

Constructor

new (require("store/String"))(entryURI, resourceURI, entryStore, data)

Source:
Parameters:
Name Type Description
entryURI string

URI to an entry where this resource is contained.

resourceURI string

URI to the resource.

entryStore EntryStore

the API's repository instance.

data string

the actual string, may the empty string, but not null or undefined.

Methods

commit() → {Promise}

Source:
See:
  • String#setString

Pushes the string back to the repository.

Returns:
Type
Promise

getString() → {string}

Source:
Returns:

may be an empty string, never null or undefined.

Type
string

setString(string) → {StringResource}

Source:
See:
  • String#commit

Set a new string, does not save it to the repository, use commit for that. E.g.

stringresource.setString("New value").commit().then(function() {...});
Parameters:
Name Type Description
string string

the new string

Returns:

allows chaining with commit.

Type
StringResource