#signals

6 bookmarks tagged with #signals · RSS Feed · ← All Tags

Web Performance Calendar » Signals: the nitty-gritty

https://calendar.perfplanet.com/2022/signals-the-nitty-gritty/
Mostly revealed to the Web by Solid.js, shortly after embraced by Preact, but also blended into usignal, or implemented by many others, this pattern convinced tons of developers that hooks might not be the best solution to reactivity out there, but while the concept might look and feel super simple and natural to deal with, the complexity behind spans from 30LOC to pretty convoluted code bases.

Django Signals enable Aspect-Oriented programming. by Elf Sternberg

http://www.elfsternberg.com/2010/07/29/lightbulb-django-signals-aspectoriented-programming
"This is exactly the kind of cross-cutting concern (note the use of a signal publisher for notification!) that would be better handled with a signal from the microblogging app. Perhaps the app could have published “tweet received” as a signal, with an optional “module for common associated applications” dispatching that event to logging, activity streams, notifications or whatever as available. The presence of explicit publication would have signaled to any developer to look for subscribers, so I don’t think this is a dangerous case of unlabeled subroutines and the potential for spaghetti code that goes with it. Most Django apps are small silos of code; it would not have been onerous to separate out and isolate this cross-cutting concern from the rest of the microblogging application’s functionality."