local Rx = require 'Rx'

local AnonymousObservable = Rx.AnonymousObservable

return function(self)

    return AnonymousObservable(function(observer)

        return self:subscribe(
            nil,
            function(...)
                return observer:onError(...)
            end,
            function(...)
                return observer:onCompleted(...)
            end)

    end, self)

end
