Small utility module for IDs.
- Source:
Methods
(static) getSetIDHandler() → {function}
Get a handler that can be attached to a Thinky model as an instance method, and that obtains a UUID to a document and assigns it, but does not save.
This is occasionally useful when we want to get an ID before saving.
- Source:
Returns:
See SetID~_setID.
- Type
- function
(async, inner) _setID() → {model}
Obtain a UUID and assign it to the object as the .id
property.
This:
- model
- Source:
Returns:
document of the model this handler was assigned to, with ID set, or unmodified if it already had one
- Type
- model