-
Notifications
You must be signed in to change notification settings - Fork 5
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
V3.1.0 #20
V3.1.0 #20
Conversation
* @returns {Promise<any>} | ||
* @memberof Chainable | ||
*/ | ||
async process(): Promise<any> { |
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.
I would favour an implementation without this method (at least without requirement to always call it - might be inconvenient and people may forget to call process
and thus wonder what is wrong).
A flag (with default value) in the constructor could determine whether the call to process
is needed or not. With that one would have the freedom do define the chain earlier and process it at a certain point by calling process
explicitly. Defaultly the processing should immediately start.
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.
How would you suggest to trigger the processing the chain ?
I saw the same approach in Lodash, when we chain, we have to call the value()
method to get the final value.
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.
New implementation, does not require to call if the last method does not return an array.
Todo:
New features:
Added Chainable functionality to support to chain async function. (Except
aForEach
)https://github.com/rpgeeganage/async-ray/blob/f61a3856089a313ee94b09de133f5611c56ea206/test/chainable.ts
Exported individual methods to use independently.
https://github.com/rpgeeganage/async-ray/blob/f61a3856089a313ee94b09de133f5611c56ea206/test/individual.ts