Skip to content

Commit eef8ce7

Browse files
committed
add missing doc
1 parent f60aec6 commit eef8ce7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export class RedisCache implements ICache {
5555
return this;
5656
}
5757

58+
/**
59+
* It enables or disables the cache.
60+
* @param {boolean} enable - boolean
61+
* @returns RedisCache.
62+
*/
5863
public enable(enable: boolean): RedisCache {
5964
this._enable = enable;
6065
return this;
@@ -212,6 +217,13 @@ export class RedisCache implements ICache {
212217
}
213218
}
214219

220+
/**
221+
* It sets a value in the cache.
222+
* @param {string} key - The key to set.
223+
* @param {any} value - The value to be stored in the cache.
224+
* @param {number} ttl - The time-to-live in milliseconds for the key.
225+
* @returns A promise.
226+
*/
215227
async put(key: string, value: any, ttl: number = this._ttl): Promise<boolean> {
216228
try {
217229
await this.destroy(key);
@@ -224,7 +236,7 @@ export class RedisCache implements ICache {
224236
/**
225237
* For each tag, if the key is not a member of the tag, add the key to the tag.
226238
* @param {string} key - The key to add to the set.
227-
* @returns Nothing.
239+
* @returns A Promise.
228240
*/
229241
private async _addTags(key: string) {
230242
const tagPromises = this._tags

0 commit comments

Comments
 (0)