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
I've been playing around with the library, and after reading up on the README it looks like anytime you use .on vs .once for anything (in my case KVO), you have to push the listener into an array.
I was trying out .on without pushing on an array and everything looked fine. Can you explain a little more how this works out, and why I shouldn't be using .on without pushing into an array? Also, is there any cleanup I have to do for .on instead of .once?
Thanks
The text was updated successfully, but these errors were encountered:
Hey @aleclarson can you explain what was a regression? Basically, if I use .on for anything, store the callback in an array, and do nothing else? Or do you mean everything works correctly in that I can use .on and .once in the same way?
Glad you like it! Check out my other Swift repos, they might help you out. 😄
Any Listener you create using on()must be retained. Otherwise, it's released at the end of your function. This was just fixed in v3.1 to work as expected. 👍
Any Listener created with once() is retained for you! So fire and forget.
I've been playing around with the library, and after reading up on the README it looks like anytime you use .on vs .once for anything (in my case KVO), you have to push the listener into an array.
I was trying out .on without pushing on an array and everything looked fine. Can you explain a little more how this works out, and why I shouldn't be using .on without pushing into an array? Also, is there any cleanup I have to do for .on instead of .once?
Thanks
The text was updated successfully, but these errors were encountered: