Generic Events
61,107 Views
-
listenable_event<public>(t:type):= class(event(t),listenable(t)): var Subscribers : [cancelable_unique]type {_(:t):void} = map{} Signal<override>(Val:t):void= (super:)Signal(Val) CallSubscribers(Val) Subscribe<override>(Callback:type {_(:t):void})<transacts>:cancelable= NewSub := cancelable_unique: CancelCallback := ReleaseSubscriber if. set Subscribers[NewSub] = Callback NewSub CallSubscribers<private>(Val:t):void= for(Key->Callback : Subscribers): Callback(Val) ReleaseSubscriber<private>(Cancelable : cancelable_unique)<transacts>:void= set Subscribers = Subscribers.RemoveKey(Cancelable) listenable_event<public>():= listenable_event(tuple()) cancelable_unique := class<unique>(cancelable): CancelCallback : type{_(:cancelable_unique)<transacts>:void}
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.