function Rx.combineLatestAll()return function(F)assert(Observable.isObservable(F),"\066\097\100 \111\098\115\101\114\118\097\098\108\101")return Observable.new(function(B)local N={}local j=Maid.new()local x=true j:GiveTask(function()x=false end)j:GiveTask(F:Subscribe(function(F)assert(Observable.isObservable(F))table.insert(N,F)end,function(...)B:Fail(...)end),function()if not x then return end;(j:GiveTask(Rx.combineLatest(N))):Subscribe(B:GetFireFailComplete())end)return j end)end end

function Rx.combineLatestAll()
	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			local observables = {}
			local maid = Maid.new()

			local alive = true
			maid:GiveTask(function()
				alive = false
			end)

			maid:GiveTask(source:Subscribe(
				function(value)
					assert(Observable.isObservable(value))

					table.insert(observables, value)
				end,
				function(...)
					sub:Fail(...)
				end),
				function()
					if not alive then
						return
					end

					maid:GiveTask(Rx.combineLatest(observables))
						:Subscribe(sub:GetFireFailComplete())
				end)

			return maid
		end)
	end
end
