-- Compiled with roblox-ts v3.0.0 local TS = _G[script] local useHookState = TS.import(script, script.Parent.Parent, "topo").useHookState local useChange = TS.import(script, script.Parent, "use-change").useChange local function useDestructor(destructor, dependencies, discriminator) local storage = useHookState(discriminator, function(state) local _result = state.destructor if _result ~= nil then _result() end return false end) if not dependencies or useChange(dependencies, storage) then local _result = storage.destructor if _result ~= nil then _result() end storage.destructor = destructor end end return { useDestructor = useDestructor, }