<commit_before>//
//  Store.swift
//  RxSwiftFlux
//
//  Created by <NAME> on 2017/06/14.
//  Copyright © 2017年 <NAME>. All rights reserved.
//

import RxSwift
import RxCocoa

public struct StoreVariable<Base> {
    let base: Base
    
    public init(_ base: Base) {
        self.base = base
    }
}

public protocol StoreVariableCompatible {
    associatedtype CompatibleType
    
    var sv: StoreVariable<CompatibleType> { get set }
}

public extension StoreVariableCompatible {
    var sv: StoreVariable<Self> {
        get {
            return StoreVariable(self)
        }
        set {
            // this enables using AnyVariable to "mutate" base object
        }
    }
}

public class Store: ReactiveCompatible, StoreVariableCompatible {
    
    let disposeBag = DisposeBag()
    
    func bind<O, E>(_ observable: O, _ param: Variable<E>) where O: ObservableType, E == O.E {
        observable.bind(to: param).addDisposableTo(disposeBag)
    }
    
    func bind<O, E>(_ observable: O, _ param: PublishSubject<E>) where O: ObservableType, E == O.E {
        observable.bind(to: param).addDisposableTo(disposeBag)
    }
}<commit_msg>[Modify] Make Store be an open class<commit_after>//
//  Store.swift
//  RxSwiftFlux
//
//  Created by <NAME> on 2017/06/14.
//  Copyright © 2017年 <NAME>. All rights reserved.
//

import RxSwift
import RxCocoa

public struct StoreVariable<Base> {
    let base: Base
    
    public init(_ base: Base) {
        self.base = base
    }
}

public protocol StoreVariableCompatible {
    associatedtype CompatibleType
    
    var sv: StoreVariable<CompatibleType> { get set }
}

public extension StoreVariableCompatible {
    var sv: StoreVariable<Self> {
        get {
            return StoreVariable(self)
        }
        set {
            // this enables using AnyVariable to "mutate" base object
        }
    }
}

open class Store: ReactiveCompatible, StoreVariableCompatible {
    
    let disposeBag = DisposeBag()
    
    func bind<O, E>(_ observable: O, _ param: Variable<E>) where O: ObservableType, E == O.E {
        observable.bind(to: param).addDisposableTo(disposeBag)
    }
    
    func bind<O, E>(_ observable: O, _ param: PublishSubject<E>) where O: ObservableType, E == O.E {
        observable.bind(to: param).addDisposableTo(disposeBag)
    }
}
{'fraction_non_alphanumeric': 0.1038511466897447, 'fraction_numerical': 0.01038511466897447, 'mean_word_length': 2.573415765069552, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3791628', 'n_tokens_mistral': 756, 'n_tokens_neox': 711, 'n_words': 196}