Event.On cannot use expiration logic? #598
Unanswered
GeekStocks
asked this question in
Q&A
Replies: 1 comment 4 replies
-
I'd created |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a need to respond to an event one (and only one) time. In other frameworks I am used to seeing
.On
and.Off
logic so that a listener can be removed after the first run (in my use case). I was surprised to see there is no.Off
in Wails and I was going to propose a pull request to add it. That is, until I read the rather fancy expiration logic already written inManager.Start()
:So since you've already implemented a way to expire a listener after x runs, why does
.On
not expose it here, but rather just hard codes a zero?Have I missed the proper way to
.On
an event x number of times? Thanks!Beta Was this translation helpful? Give feedback.
All reactions