mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* [ADF-3323] Fixed URL path to Typescript source files * [ADF-3323] Fixed and checked broken links caused by previous bug
1.6 KiB
1.6 KiB
Added, Status
Added | Status |
---|---|
v2.0.0 | Active |
Storage service
Stores items in the form of key-value pairs.
Class members
Methods
- clear()
Removes all currently stored items. - getItem(key:
string
):string|null
Gets an item.- key:
string
- Key to identify the item - Returns
string|null
- The item (if any) retrieved by the key
- key:
- hasItem(key:
string
):boolean
Is any item currently stored underkey
?- key:
string
- Key identifying item to check - Returns
boolean
- True if key retrieves an item, false otherwise
- key:
- removeItem(key:
string
)
Removes a single item.- key:
string
- Key to identify the item
- key:
- setItem(key:
string
, data:string
)
Stores an item- key:
string
- Key to identify the item - data:
string
- Data to store
- key:
Details
The service will check to see if web storage is available on the browser. If it is available then the service will use it to store the key-value items persistently. Web storage can be used in a similar way to cookies but with a much higher size limit (several MB for web storage compared to a few KB for cookies). However, cookies are more widely supported by browsers and can be set to expire after a certain date.
If local storage is not available then non-persistent memory storage within the app is used instead.