A memento represents a storage utility. It can store and retrieve values.
A memento represents a storage utility. It can store and retrieve values.
(get memento key)
(get memento key default-value)
Return a value.
Parameters:
key
: string
- A string.default-value
: T
- A value that should be returned when there is no
value (undefined
) with the given key.Returns: T
- The stored value or the defaultValue.
Return a value. **Parameters:** - `key`: `string` - A string. - `default-value`: `T` - A value that should be returned when there is no value (`undefined`) with the given key. **Returns:** `T` - The stored value or the defaultValue.
(keys memento)
Returns the stored keys.
Returns: readonly string[]
- The stored keys.
Returns the stored keys. **Returns:** `readonly string[]` - The stored keys.
(update memento key value)
Store a value. The value must be JSON-stringifyable.
Note that using undefined
as value removes the key from the underlying
storage.
Parameters:
key
: string
- A string.value
: any
- A value. MUST not contain cyclic references.Returns: Thenable<void>
Store a value. The value must be JSON-stringifyable. *Note* that using `undefined` as value removes the key from the underlying storage. **Parameters:** - `key`: `string` - A string. - `value`: `any` - A value. MUST not contain cyclic references. **Returns:** `Thenable<void>`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close