Skip to main content

Function: getItem

getItem(key, storage?, secure?): Promise<unknown>

get a value of a key from the specified storage if the storage is set to any, try all storage

Parameters

NameTypeDefault valueDescription
keystringundefined: name of the key to get the value from
storagestring'any': localStorage, sessionStorage, cookie, any (defaults to any)
securebooleantrue: decrypt the cookie (defaults to true)

Returns

Promise<unknown>

Defined in

onekijs/packages/onekijs-framework/src/utils/storage.ts:62