jbreckmckye / trkl

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

just wanted to say #1

Closed katywings closed 7 years ago

katywings commented 7 years ago

Very clever solved with the read function and the computation tracker :). At first I really wondered, how is he doing this computed thing without directly referencing the dependencies. But when I saw the read function it made click 👍

How is the stacktrace for errors in subscriber functions, is it good readable?

I am thinking about using your lib for handling ui state. (Already using flyd for application state and i think this could be a dream team)

jbreckmckye commented 7 years ago

Firstly, than you for the compliment! I hope trkl proves a useful library for others. I'm always interested to hear if people are using it.

As to your question about errors:

How is the stacktrace for errors in subscriber functions?

Less than transparent. It will start with the line that failed in the subscriber, but the stack will refer to trkl's internals. Here's an example from a JSBin:

image

Another thing: if a subscriber throws an error, the whole data flow will stop. This might not be ideal in very large applications.

Ultimately trkl is simple. Simple as in small and straightforward, but also simple as in dumb.

What kind of error behaviour would you like, if you had the choice? Providing it's not too complicated, I'd always consider adding it.

katywings commented 7 years ago

Thanks for your detailed feedback and the example, when I looked at it, JSbins src was minified and I couldnt really see how it would look like in the real world :D. I will do some cross browser testing in the next few weeks (sry, dont have a lot of time currently ^^). Generally speaking, I especially like the simplicity of trkl - thats what making it fast for UI State - i hope :)!