3 ms·
Button should not have any behavior, it should generate an event. Your app can have one or multiple listeners for this event. This pattern is battle-tested for
by EugeneOZ 5y ago
Button should not have any behavior, it should generate an event. Your app can have one or multiple listeners for this event. This pattern is battle-tested for decades.
- recursivedoubts 5y agoOK, but the response to that event should be localized to the button. https://htmx.org/essays/locality-of-behaviour/ https://htmx.org/essays/locality-of-behaviour/
- JasonCannon 5y agoWhy? Have any reading on this?
- EugeneOZ 5y agoOf course :) Have you tried to find something before asking? https://en.m.wikipedia.org/wiki/Reactive_programming https://en.m.wikipedia.org/wiki/Reactive_programming https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener https://developer.mozilla.org/en-US/docs/Web/API/EventTarget...
- JasonCannon 5y ago1.) Don't be a jackass. 2.) I know what reactive programming is, I make extensive use of RxJS at work. And I obviously know what an event listener is. I was asking why is it wrong to have the button have functionality and only emit events. And I did google that, but nothing from your comment you posted that I googled lead to anything about reactive programming.
- EugeneOZ 5y ago1) You started it :) Your sarcastic tone was ridiculously obvious :) I gave you the links - where is your gratitude? You’ve only brought your sarcasm here. 2) Oh, RxJS is synonymous with reactive programming for you? Lol, keep learning :)