hey guys, I have been working with OOP a lot lately and have found myself making custom events a lot, like Car.Stopped, for example. As it is now, the usual approach for this sort of thing is to just make a bindable event. I don’t like the idea of making a new bindable event and having the responsibility of managing it, so I created a custom signal class that does not use bindable events. It has a few other upsides:
- It does not use any sort of repeat loops to yield, it uses coroutines and the task library.
- metatables can be passed, making it more flexible than current RBXScriptSignals
- room for new features
- in my testing, it has perfect performance compared to the usual bindable event method
you can find it here:
it has everything current RBXScriptSignals have, including :Wait(), :Connect(), and connections can be disconnected with :Disconnect().
I would love feedback on memory management here, I don’t know the best approaach for a dedicated :Destroy() function. the current one sets the entire signal to an empty table, which is good enough for me considering it will be gc’ed anyways, but I know some people might not be happy with that.
the great thing about this is that I can add features that I’ve always felt were missing from RBXScriptSignals. for example, a timeout to :Wait(). ive actually just added that because I feel that its an important thing to have