3 ms·
To be fair, reagent uses it's own implementation that satisfy atom protocol. And it uses some funky magic with keeping derefs and triggering rerenders. In princ
by dhucerbin 7y ago
To be fair, reagent uses it's own implementation that satisfy atom protocol. And it uses some funky magic with keeping derefs and triggering rerenders. In principle, as atom is idiomatic Clojure, setState is idiomatic javascript. ratoms and hooks both add some sugar to it.
- pgt 7y ago`setState(...)` is not idiomatic in JavaScript.
- dhucerbin 7y agoI'm not sure how far back you want to go, but `this.set` is used in most frontend frameworks, starting around knockout and backbone. You had object which managed state for you (then it was model, today it is component) and it had some setter method.