question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] EventHandler as [Attribute]

See original GitHub issue

I was recently checking out Dapr, and saw this really interested and simple way to invoke event handlers

[Topic("pubsub", "newOrder")]
[HttpPost("/orders")]
public async Task<ActionResult> CreateOrder(Order order)

Simply adding the Topic attribute.

At the moment I am doing a lot of Event Driven stuff with ABP and I am finding the overhead in creating a handler for every action a bit much, it would be nice to just have a service with all the functions in for a specific domain, and then I can just append a [AsyncHandles<ISomeEventData>] or even go one further and perhaps even throw a resolver in there [AsyncHandles<ISomeEventData, Order>((edata, orderRepo) => return orderRepo.Get(edata.orderId))] and then the function below would be provided the order directly.

I am still fairly new to EDD so I may not be going the most productive way about it, but I just think it would be a nice addition to ABP.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ismcagdascommented, May 27, 2021

@worthy7 sorry for my late reply. You can create an Interceptor and achieve this in your application. However, we don’t want to create new interceptors in the framework itself because it causes performance problems.

0reactions
zx493734247commented, Jun 1, 2021

Perhaps I could just integrate Dapr sure.

thanks very much

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event handling (overview) - Event reference - MDN Web Docs
Event handler code can be made to run when an event is triggered by assigning it to the target element's corresponding onevent property,...
Read more >
Event Handling with Event Handler Properties
eventHandler is the name of the event handler property that we're accessing on the target. In our example, the event handler property is...
Read more >
HTML 5 Event Handler Content Attributes
Event handler content attributes are often referred to simply as "event handlers". Below are the event handlers available in HTML.
Read more >
Chapter 17. Assigning Event Handlers with HTML Attributes
WIRING UP EVENT HANDLERS ... The name of an attribute used to handle events is the word on followed by the name of...
Read more >
What are the HTML On Attributes ? (known also as event ...
A body event handler that calls a function with: this that gives access back to the element. and the Window.event (or for short...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found