function CancelToken.fromMaid(Q)local x=CancelToken.new(EMPTY_FUNCTION)local H=Q:GiveTask(function()x:_cancel()end)x.PromiseCancelled:Then(function()Q[H]=nil end)return x end
--[=[
	Constructs a new CancelToken that cancels whenever the maid does.

	@param maid Maid
	@return CancelToken
]=]
function CancelToken.fromMaid(maid)
	local token = CancelToken.new(EMPTY_FUNCTION)

	local taskId = maid:GiveTask(function()
		token:_cancel()
	end)

	token.PromiseCancelled:Then(function()
		maid[taskId] = nil
	end)

	return token
end
