bennofs / reflex-host

Higher level support for implementing reflex frameworks
Other
30 stars 11 forks source link

What is the IO Bool of newExternalEvent #10

Closed MarisaKirisame closed 6 years ago

MarisaKirisame commented 6 years ago

I get that it is a trigger, but what does the Bool do?

bennofs commented 6 years ago

This is a good question (ugh, I wrote unreadable code 6 months ago)! It looks like this tells you if anything is reacting to that event. If it returns False, that means that it did not get any trigger which usually happens if nothing is listening for that event. Not sure what that would be useful for though, since you cannot rely on that remaining the same in the future, so you can't unregister any handlers even if it returns False?

I would be happy to accept a PR that decribes the meaning of this value.

MarisaKirisame commented 6 years ago

I am not very sure about it, maybe it is the best if you commit it yourself? Also, it look like providing additional a function of IO () is good (since it will be more stable)