Closed YarikTH closed 1 year ago
It's easier to just introduce enum class observe_policy:
enum class observe_policy
{
skip_current. ///< default behavior. Notify only when signal value has changed
notify_current ///< notify current value, then when signal value has changed
};
So we don't need to introduce new adaptors like observe_and_call, tap_and_call, but only provide additional argument for signal observations.
Description
Currently
ureact::observe
only allows to subscribe to the future changes of observable value. But in case ofureact::signal
there is also current value that could be also needed in passed functor. Currently for the same user should call functor manually with the initial value.Need to research API of analogs if they came up with a good names or approaches for such cases.