SirMallard / Iris

Iris is an Immediate-Mode GUI Library for Roblox for creating debug and visualisation UI and tools and based on Dear ImGui.
https://sirmallard.github.io/Iris/
MIT License
178 stars 25 forks source link

:Disconnect method for Iris:Connect and State:OnChange objects #57

Closed Michael-48 closed 4 months ago

SirMallard commented 4 months ago

Should be fixed here: 95e923265dfdb4087cd88a258930722c0ba0cb1e

I don't think there's a better way to do this without creating a new table data structure. I was initially concerned that setting a table element to nil would decrease the table length, but it looks like this method works fine.

Michael-48 commented 4 months ago

This is probably the better way to do this. A table with nothing except a Disconnect method just for the sake of consistency with RBXScriptConnection instances is overkill now that i think of it.

SirMallard commented 4 months ago

Yeah, it would be nice, but there are other examples of where returning the disconnect callback is perfectly fine.