It bucks the conventional understanding of how signals might be used, but it means that we don’t need this distinction.
Conversation
Our view models are a collection of inputs and outputs. Some of which are effectful. All of which are signals.
1
What does it mean for an output to be effectful?
1
e.g., resulting in the presentation of a new view controller, or the view model beginning a network request.
1
OK. How do you express those effects as outputs in the interface?
1
My point is exactly that _you don’t need to_. Why is it important? The effects are an implementation detail.
2
Trying to figure out how this is different from any object which performs effects when it e.g. receives a message.
2
My remaining concern is: most of most view models are totally pure. Why not isolate the impurities?
1
That isolation is an implementation detail (but maybe could still be valuable), because the signal interface isolates it.
1
Consumers of the signal interface don’t know or care whether it’s impure, because the effects have been isolated already.
2
Replying to
I definitely care whether the VM's subscription is pure for the same reason I care if a function I'm calling is pure.
Replying to
I’m not sure what “subscription” you’re referring. Signals are usually activated (directly or indirectly) by the view.
2
What I mean is: if I send an event to this signal, are effects going to happen?
1
Show replies

