Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node: Allow chaining function calls on transaction. #902

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

nihohit
Copy link
Contributor

@nihohit nihohit commented Feb 5, 2024

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

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linter failed

@@ -77,21 +77,26 @@ import { redis_request } from "./ProtobufMessage";
* await client.exec(transaction);
* [OK , "value"]
*/
export class BaseTransaction {
export class BaseTransaction<T extends BaseTransaction<T>> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update example above

@@ -866,6 +881,6 @@ export class Transaction extends BaseTransaction {
* Specific response types are documented alongside each method.
*
*/
export class ClusterTransaction extends BaseTransaction {
export class ClusterTransaction extends BaseTransaction<ClusterTransaction> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example here as well?

Copy link
Collaborator

@acarbonetto acarbonetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@barshaul barshaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@shachlanAmazon shachlanAmazon merged commit 86487cd into valkey-io:main Feb 6, 2024
6 checks passed
@nihohit nihohit deleted the builder-transaction branch February 7, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants