 import UIKit
 import ReactiveSwift
 import RealmSwift
+import PKHUD
 
 fileprivate typealias StudySubmitAction = Action<[StudyEntry], [SignalProducer<Response,FetchError>], FetchError>
 fileprivate typealias SubmitStarter = ActionStarter<[StudyEntry], [SignalProducer<Response, FetchError>], FetchError>

        
        isSubmitting <~ chunkSubmitProducers.map { $0.count > 1 }

        refreshAction = RefreshAction { _ in
            return StudyRefreshRequest().requestProducer()!
        }
        

            return entries.filter { !$0.synced }
        }
        
        shouldEnableSubmit <~ Property.combineLatest(unsyncedEntries, isSubmitting).map { (unsynced, submitting) in
            return unsynced.count > 0 && !submitting
        }
        
        submitAction = StudySubmitAction(enabledIf: shouldEnableSubmit, StudyEngine.submitActionProducer)
        
