-
-
Notifications
You must be signed in to change notification settings - Fork 388
Closed
Description
Is your feature request related to a problem? Please describe.
Method chaining can help simplify code.
Describe the solution you'd like
I have a code block like this:
const hash256 = (str) => {
const shaObj = new jsSHA('SHA-256', 'TEXT');
shaObj.update(str);
return shaObj.getHash('HEX');
}I thought I could simplify it like this:
const hash256 = (str) => new jsSHA('SHA-256', 'TEXT').update(str).getHash('HEX');But it won't be possible since update returns void and not this.
Perhaps it could return this so that chaining becomes possible.
Metadata
Metadata
Assignees
Labels
No labels