jbreckmckye / trkl

Reactive microlibrary with observables and spreadsheet-style computed values in 383 bytes
Apache License 2.0
187 stars 5 forks source link

Why need use array to wrap runComputed? #10

Closed yolio2003 closed 2 years ago

yolio2003 commented 2 years ago

I noticed that the computationToken is wrapped as array [runComputed], i didn't understand the intent of this usage, just want to ask why. thx.

jbreckmckye commented 2 years ago

It's a long time since I wrote this, about six years or so. I'm not sure, actually.

My first thought was that I must have been trying to give the computationToken a unique struct to identify it for detectCircularity, but given that the runComputed is an inline function I don't think it's needed.

Maybe runComputed wasn't always an inline function? Maybe I intended to add some other 'metadata' to a tuple? It's been so long, I really can't remember

Anyway, I reckon we can get rid of it, shave off >2 bytes.

yolio2003 commented 2 years ago

haha, it's ok, thank you very much!