 import RxSwift
 import RxCocoa
 
-/// A get-only `Variable` that is equivalent to ReactiveSwift's `Property`.
+/// A get-only `BehaviorRelay` that works similar to ReactiveSwift's `Property`.
 ///
 /// - Note:
-/// This will send `.completed` when deallocated, just like `Variable` but not like `BehaviorRelay`.
-/// Thus, this class doesn't conform to `ObservableConvertibleType` for avoiding this being captured accidentally.
+/// From ver 0.3.0, this class will no longer send `.completed` when deallocated.
 ///
 /// - SeeAlso:
 ///     https://github.com/ReactiveCocoa/ReactiveSwift/blob/1.1.0/Sources/Property.swift

        let disposeBag = DisposeBag()
        _disposeBag = disposeBag

        _variable = Variable(initial)

        observable
            .bind(to: _variable)
            .disposed(by: disposeBag)
    }

    /// Observable that synchronously sends current element and then changed elements.
    /// This is same as `ReactiveSwift.Property<T>.producer`.
    public func asObservable() -> Observable<E> {
        return _variable.asObservable()
    }

    /// Observable that only sends changed elements, ignoring current element.


    public typealias E = Element

    private let _behaviorRelay: BehaviorRelay<E>
    private let _disposeBag: DisposeBag?

    /// Gets current value.
    public var value: E {
        get {
            return _behaviorRelay.value
        }
    }

    /// Initializes with initial value.
    public init(_ value: E) {
        _behaviorRelay = BehaviorRelay(value: value)
        _disposeBag = nil
    }

    /// Initializes with `BehaviorRelay`.
    public init(_ behaviorRelay: BehaviorRelay<E>) {
        _behaviorRelay = behaviorRelay
        _disposeBag = nil
    }

    /// Initializes with `Variable` (DEPRECATED).
    @available(*, deprecated, message: "Use `init(_ behaviorRelay:)` instead. Note that `Variable` will not be captured.")
    public convenience init(capturing variable: Variable<E>) {
        self.init(variable)
    }

    /// Initializes with `Variable` (DEPRECATED).
    @available(*, deprecated, message: "Use `init(_ behaviorRelay:)` instead.")
    public convenience init(_ variable: Variable<E>) {
        self.init(initial: variable.value, then: variable.asObservable())
    }

    /// Initializes with `Observable` that must send at least one value synchronously.
