function Rx.using(l,s)return Observable.new(function(b)local p=Maid.new()local W=l()p:GiveTask(W)local R=s(W)assert(Observable.isObservable(R),"\066\097\100 \111\098\115\101\114\118\097\098\108\101")p:GiveTask(R:Subscribe(b:GetFireFailComplete()))return p end)end

function Rx.using(resourceFactory, observableFactory)
	return Observable.new(function(sub)
		local maid = Maid.new()

		local resource = resourceFactory()
		maid:GiveTask(resource)

		local observable = observableFactory(resource)
		assert(Observable.isObservable(observable), "Bad observable")

		maid:GiveTask(observable:Subscribe(sub:GetFireFailComplete()))

		return maid
	end)
end
