The add method adds a value when key doesn't exists. Returns true when key doesn't exists otherwise false will be returned.
You can provide a ttl value. If null is passed, the item will not expire.
The increment method increments the given key with given value. Returns true if the key where incremented otherwise false will be returned.
If values is not defined then it will increment the key with 1.
An error will thrown if the key is not a number.
The
ICacheAdaptercontract defines a way for storing key-value pairs with expiration independent of data storage.IMPORT_PATH:
"@daiso-tech/core/cache/contracts"