Permalink
0b66f66 Jan 29, 2017
2 contributors

Users who have contributed to this file

@kzaher @mohsenr
33 lines (26 sloc) 643 Bytes
//
// NopDisposable.swift
// RxSwift
//
// Created by Krunoslav Zaher on 2/15/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
/// Represents a disposable that does nothing on disposal.
///
/// Nop = No Operation
fileprivate struct NopDisposable : Disposable {
fileprivate static let noOp: Disposable = NopDisposable()
fileprivate init() {
}
/// Does nothing.
public func dispose() {
}
}
extension Disposables {
/**
Creates a disposable that does nothing on disposal.
*/
static public func create() -> Disposable {
return NopDisposable.noOp
}
}