Currently fawning over `@preact/signals-core`, a tiny signals implementation that can be used independently of the (P)react ecosystem 🏆
https://github.com/preactjs/signals
Preact is a treasure and I would love to see more zero-dependency utilities like this please and thank you.
19 replies
anyway reactivity is ORM for the front-end send toot
-
@fasterthanlime hi, I’m not smart enough to know better 🫠
-
@fasterthanlime haha—for science!
-
@zachleat wish more people knew this
@zachleat Is that good or bad?
@agocke both! neither! it depends!
@zachleat @fasterthanlime leaky abstraction that still abstracts well over 95% of cases… makes sense!
-
@zachleat Ah, yes, dependency-free utilities... like https://www.npmjs.com/package/is-negative 🤪 They're the best!
@westbrook not like this
not like this
@zachleat I found Preact’s signals to be *very* difficult to use for two reasons:
1. It’s hard to mix with reactive code, so it’s hard to gradually migrate an existing code base
2. There’s no destructor / unwatch hook. That means I can’t build complex classes out of signals and treat them like signals. That, in turn, makes it hard to mix signals with imperative APIs like graphs.
@zachleat Vue’s reactivity package is very similar! https://github.com/vuejs/core/tree/main/packages/reactivity
I just wish Angular’s signals (my favorite implementation) could be used independent of Angular 😞
@zachleat Please note that Preact Signals are not supported by React. If you want to try them with a similar framework, migrate to Preact.
@nickm you had me at “migrate to Preact.”