You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
should notify subscribers only if value != newvalue - conditional notification;
But there is a practical need for unconditional fire also, I propose to add send(newValue) method:
signal.send(newvalue); // fires the signal unconditionally
Problem arises in situations like this:
objectChanged = signal(null);
...
obj.foo = "a";
objectChanged.value = obj; // sends notification as obj !== null;
...
obj.bar = "b";
objectChanged.value = obj; // oops, will not send notification, as the value (obj) is the same and was set in galaxy far, far away
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This
should notify subscribers only if
value != newvalue
- conditional notification;But there is a practical need for unconditional fire also, I propose to add
send(newValue)
method:Problem arises in situations like this:
Beta Was this translation helpful? Give feedback.
All reactions