Skip to content

Comment on JavaScript (client-side) Messaging Anti-Patternsparent

Comments

Well said. I've used the second pattern you described as well. If I find myself in a situation where I'm tempted to treat the message as mutable, it usually indicates I've hit the point where I need to (potentially) use some sort of transformation pipeline, and the steps in that transformation should ideally be encapsulated inside a component and not publicly exposed on the bus itself.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.