Skip to content

cleanup function since v0.2

Attempts to destroy all destructible objects passed to it.

(...any) -> ()

Parameters

  • ... - Any objects that need to be destroyed.

Example Usage

Fusion.cleanup(
    workspace.Part1,
    RunService.RenderStepped:Connect(print),
    function()
        print("I will be run!")
    end
)

Destruction Behaviour

Destruction behaviour varies by type:

  • if Instance, :Destroy() is called
  • ...else if RBXScriptConnection, :Disconnect() is called
  • ...else if function, it is called
  • ...else if {destroy: (self) -> ()}, :destroy() is called
  • ...else if {Destroy: (self) -> ()}, :Destroy() is called
  • ...else if {any}, Fusion.cleanup is called on all members
  • ...else nothing occurs.
Back to top