Skip to content

Are setters needed? #331

Answered by ryansolid
ranmacar asked this question in Q&A
Discussion options

You must be logged in to vote

It's mostly to enforce unidirectional flow. Which while might seem like it is to guard infinite loops is more than about avoiding the worst case.

I don't think the default should be that passing the signal also passes around the ability to write to it. It's about keeping it known explicitly when we are mutating. It also tends to make it more burdensome and explicit to allow other places to update them.

There is this sort of ambiguity when you get a thunk and am like can I pass an argument to it and set it? Or better, should I be able to set it? Thinks like async derivations where you can't use the synchronous primitive so you use the signal but then something else could write to it. Sure …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ryansolid
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #329 on February 05, 2021 01:14.