The IReadableCache contract defines a way reading for as key-value pairs independent of data storage.
IReadableCache
IMPORT_PATH: "@daiso-tech/core/cache/contracts"
"@daiso-tech/core/cache/contracts"
The exists method returns true when key is found otherwise false will be returned.
exists
key
The get method returns the value when key is found otherwise null will be returned.
get
The getOr method will retrieve the given key if found otherwise defaultValue will be returned.
getOr
defaultValue
can be regular value, sync or async Invokable value and ITask value.
Invokable
ITask
The getOrFail method returns the value when key is found otherwise an error will be thrown.
getOrFail
KeyNotFoundCacheError
The missing method returns true when key is not found otherwise false will be returned.
missing
The
IReadableCachecontract defines a way reading for as key-value pairs independent of data storage.IMPORT_PATH:
"@daiso-tech/core/cache/contracts"