listSet
Uniquely identify the set of data a list contains.
connection.listSet(list)
Returns the value of the property referenced by listSetProp if it exists.
By default, this will return list.__listSet
.
Parameters
- list
{List}
:A list instance.
Returns
{Object}
:
An object that can be passed to JSON.stringify
to represent the list.
Use
Many behaviors, such as the constructor/store, need to have a unique identifier for a list.
This connection.listSet
method should return that.
Typically, a list's set identifier is a property on the list object. As example, a list of Todos might look like the following:
var dueTodos = todoConnection.getList({due: "today"});
dueTodos; // [{_id: 5, name: "do dishes", due:"today"}, {_id: 6, name: "walk dog", due:"today"}, ...]
dueTodos.__listSet; // {due: "today"}
todoConnection.listSet(dueTodos); // {due: "today"}
In the above example the listSetProp would be the default "__listSet"
.