Local Storage Entity
class LocalStorageEntity<T, I>(resource: Resource<T, I>, prefix: String) : EntityRepository<T, I>
Content copied to clipboard
provides crud-functions for localStorage to deal with a single entity
Parameters
resource
definition of the Resource to use
prefix
prefix used for prepending to the keys
Constructors
Functions
Link copied to clipboard
adds or updates the serialized entity to localStorage using prefix and id defined in resource
Link copied to clipboard
deletes the entity in localStorage
Link copied to clipboard
loads an entity from localStorage using prefix and id defined in resource