Replies: 5 comments 1 reply
|
This could be done via a set of extension methods without having to update the type signature! |
|
The idea never touched my mind I'm digging about something more general, |
|
Signal hooks for sure. I think that would be possible in general and would love to add support for it. It could be a wrapper signal that adds the functionality just like a change stack too |
|
Most of the logic is already there! Signal handle transmission but you just need confirmation/infirmation upfront and lifecycle of previous signal. When you |
|
I don't know if it could be a wrapper or direct implementation. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is an evolving discussion around previous/current value of a signal
and how pre/post check hook can influence the connection and help manage lifecycle.
Currently if you want to access previous value of a subscribed signal you have to
Signature would have been much better with
subscribe(previous, current)for chaining.Can be expressed with elegance when non required
$signal.subscribe((_, current) { });Maybe a real consideration for people pushing Signals it a lot of sugar to not repeat the var and less error prone.
As a general remark Signals should get inspired (copy without questions) functional signatures and move away from oop.
equalityCheckcan be hacked in the meantime, it has the right signature but come on ;DAll reactions