-
Notifications
You must be signed in to change notification settings - Fork 53
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
Conversation
This allows a builder-like pattern of calls, which is a bit more readable.
There was a problem hiding this 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>> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
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.