-
Notifications
You must be signed in to change notification settings - Fork 6
Feat/#99 implement a way to listen to other actions than default ones #122
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
base: master
Are you sure you want to change the base?
Feat/#99 implement a way to listen to other actions than default ones #122
Conversation
Codecov Report
@@ Coverage Diff @@
## master #122 +/- ##
==========================================
+ Coverage 95.15% 95.40% +0.25%
==========================================
Files 69 70 +1
Lines 1093 1154 +61
Branches 126 141 +15
==========================================
+ Hits 1040 1101 +61
Misses 53 53
Continue to review full report at Codecov.
|
| } | ||
|
|
||
| // TODO: enhance this simple check by using regex. | ||
| if (typeof actionName !== 'string' || actionName.indexOf('::') < 1) { |
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.
if I input action name *, I will get error here!.
| * @param _payload The payload of the incoming Action. | ||
| */ | ||
| matchActionType(candidateType, subscribedType, _payload?): boolean { | ||
| if (subscribedType === '*') { |
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 think it's better to allow user to subscribe to action of specific contract account. Somethings like eosio::* or governance::*
|
|
||
| protected async handleData(actionName: string, data: any, scope?: any): Promise<any> { | ||
| const handlerMap = this.#_handlersMap; | ||
| const handlerSymbols: symbol[] = handlerMap.get(actionName) || []; |
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.
In case of I subscribe handler to action *, handler will never be executed.
No description provided.