--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
local ____exports = {}
local ____context = require("hooks.context")
local getOrInitHook = ____context.getOrInitHook
local ____helpers = require("hooks.helpers")
local inputsChanged = ____helpers.inputsChanged
require("hooks.reconcilerHooks")
--- Accepts a function that contains imperative, possibly effectful code.
-- Unlike React, the effects run synchronously if the inputs have changed.
____exports.useEffect = function(callback, inputs)
    local isNew = false
    local state = getOrInitHook(
        "effect",
        function()
            isNew = true
            return {type = "effect"}
        end
    )
    if isNew or state.lastInputs and inputs and inputsChanged(state.lastInputs, inputs) then
        if state.cleanup then
            state.cleanup()
        end
        state.lastInputs = inputs
        state.cleanup = callback()
    end
end
return ____exports
