Just a thought, but wouldn't it better to have a method called #subscribeOnce:do: and let it handle the subscription removal? - Francisco
On 25 Oct 2014, at 13:42, "Jan B." <bliznjan@fit.cvut.cz> wrote:
Hi all
Today I come with a question regarding announcements. I would like to make announcement subscription which would remove itself after first use. Something like...
anObject announcer subscribe: TRMouseDragEnd do: [ :event | self thisMethodWith: differentParameters. "anObject announcer removeSubscription: ...this one..." ].
All I was able to do is write there anObject announcer unsubscribe: self. which somehow works, but this instance could have multiple subscriptions and it would remove even those I don't want to remove, I need to remove only this specific one...
Jan
-- View this message in context: http://forum.world.st/Self-removing-announcement-subscription-tp4786622.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.