Skip to content

Commit

Permalink
Add disconnect method
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Jul 24, 2024
1 parent 3550582 commit 3cd2e28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/TSRedis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export declare class TSRedis {
constructor(options?: RedisOptions & {
mocked: boolean;
});
disconnect(): void;
subscribe(callback: (message: Message) => void): void;
publish(message: Message): void;
}
Expand Down
3 changes: 3 additions & 0 deletions dist/TSRedis.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/TSRedis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export class TSRedis {
this.redis = options.mocked ? new MockRedis(options) : new Redis(options);
}

disconnect() {
return this.redis.disconnect();
}

subscribe(callback: (message: Message) => void) {
this.redis.subscribe(CHANNEL_ID, (err, count) => {
if (err) {
Expand Down

0 comments on commit 3cd2e28

Please sign in to comment.