tc39 / proposal-signals

A proposal to add signals to JavaScript.
MIT License
2.95k stars 54 forks source link

Computed signal with value diffed after compute? #165

Closed dead-claudia closed 1 month ago

dead-claudia commented 1 month ago

The idea is for things like localStorage, which often lack ways to know when it's updated. They'd also come in handy in embedded, since it's common to see an SMBus event or pin update for "state changed", but you still have to explicitly poll to know what changed.

Here's an explainer:

I'm calling it External for the purposes of this.

dead-claudia commented 1 month ago

Other designs could be possible, but I just want to make sure there's a way to define such a virtualized value that's always checked but possibly externally determined.

dead-claudia commented 1 month ago

Honestly not sure this is the right way to go, so I'm closing it.