Skip to content

Commit

Permalink
Node: Allow chaining function calls on transaction. (valkey-io#902)
Browse files Browse the repository at this point in the history
* Node: Allow chaining function calls on transaction.

This allows a builder-like pattern of calls, which is a bit more readable.

* fixes
  • Loading branch information
nihohit authored Feb 6, 2024
1 parent c95b13e commit 86487cd
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 156 deletions.
4 changes: 2 additions & 2 deletions node/src/RedisClusterClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
createPing,
} from "./Commands";
import { connection_request, redis_request } from "./ProtobufMessage";
import { BaseTransaction, ClusterTransaction } from "./Transaction";
import { ClusterTransaction } from "./Transaction";

export type ClusterClientConfiguration = BaseClientConfiguration;

Expand Down Expand Up @@ -196,7 +196,7 @@ export class RedisClusterClient extends BaseClient {
* If the transaction failed due to a WATCH command, `exec` will return `null`.
*/
public exec(
transaction: ClusterTransaction | BaseTransaction,
transaction: ClusterTransaction,
route?: SingleNodeRoute
): Promise<ReturnType[] | null> {
return this.createWritePromise(
Expand Down
Loading

0 comments on commit 86487cd

Please sign in to comment.