local v=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\078\101\118\101\114\109\111\114\101"))local E=v("\080\114\111\109\105\115\101")local F=v("\077\097\105\100")return function(v,N)local Q=v:Get(N)if Q then return E.resolved(Q)end local c=F.new()local l=E.new()c:GiveTask((v:GetClassAddedSignal()):Connect(function(v,E)if E==N then l:Resolve(v)end end))l:Finally(function()c:Destroy()end)return l end
--- Utility function to promise a bound class on an object
-- @function promiseBoundClass

local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))

local Promise = require("Promise")
local Maid = require("Maid")

return function(binder, inst)
	local class = binder:Get(inst)
	if class then
		return Promise.resolved(class)
	end

	local maid = Maid.new()
	local promise = Promise.new()
	maid:GiveTask(binder:GetClassAddedSignal():Connect(function(classAdded, instance)
		if instance == inst then
			promise:Resolve(classAdded)
		end
	end))

	promise:Finally(function()
		maid:Destroy()
	end)

	return promise
end