1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 02:54:31 +03:00

GH-405 Use disposed(by:) instead of the old addDisposableTo()

This commit is contained in:
Tae Won Ha 2017-04-22 16:30:40 +02:00
parent 090b5986e8
commit 9b9da5c4cf
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
15 changed files with 21 additions and 21 deletions

View File

@ -47,7 +47,7 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
self.updateViews()
}
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let emit: (Action) -> Void

View File

@ -79,7 +79,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.setSparkleUrl(self.useSnapshot)
}
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let stateContext: Context

View File

@ -57,7 +57,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
self.updateViews()
}
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let emit: (Action) -> Void

View File

@ -47,7 +47,7 @@ class Context {
)
.merge()
.subscribe(onNext: self.emitAppState)
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
// MainWindow.State
Observable
@ -79,7 +79,7 @@ class Context {
)
.merge()
.subscribe(onNext: self.emitAppState)
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
// Preferences
Observable
@ -100,11 +100,11 @@ class Context {
.merge()
.apply(to: prefService.forPrefPanes)
.subscribe(onNext: self.emitAppState)
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
#if DEBUG
// actionSource.debug().subscribe().addDisposableTo(self.disposeBag)
// stateSource.debug().subscribe().addDisposableTo(self.disposeBag)
// actionSource.debug().subscribe().disposed(by: self.disposeBag)
// stateSource.debug().subscribe().disposed(by: self.disposeBag)
#endif
}

View File

@ -59,7 +59,7 @@ class FileBrowser: NSView,
self.currentBufferUrl = state.currentBuffer?.url
self.showHiddenMenuItem.boolState = state.fileBrowserShowHidden
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let emit: (UuidAction<Action>) -> Void

View File

@ -55,7 +55,7 @@ class FileMonitor: UiComponent {
self.monitors.removeValue(forKey: url)
}
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let emit: (Action) -> Void

View File

@ -73,7 +73,7 @@ class FileOutlineView: NSOutlineView,
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
self.update(state.lastFileSystemUpdate.payload)
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
func select(_ url: URL) {

View File

@ -55,7 +55,7 @@ class GeneralPref: PrefPane, UiComponent, NSTextFieldDelegate {
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let emit: (Action) -> Void

View File

@ -67,7 +67,7 @@ class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate {
self.mark = serverUrl.mark
self.reloadWebview(with: serverUrl.payload)
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate func reloadWebview(with url: URL) {

View File

@ -151,7 +151,7 @@ class MainWindow: NSObject,
.subscribe(onNext: { [unowned self] action in
self.emit(self.uuidAction(for: action))
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
self.addViews()
@ -213,7 +213,7 @@ class MainWindow: NSObject,
onCompleted: {
self.windowController.close()
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
self.updateNeoVimAppearance()
self.neoVimView.delegate = self

View File

@ -89,7 +89,7 @@ class OpenQuicklyWindow: NSObject,
self.windowController.showWindow(self)
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
func reloadFileView(withScoredItems items: [ScoredFileItem]) {

View File

@ -46,7 +46,7 @@ class OpenedFileList: NSView,
self.bufferList.reloadData()
self.adjustFileViewWidth()
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let emit: (UuidAction<Action>) -> Void

View File

@ -53,7 +53,7 @@ class PrefWindow: NSObject,
self.openStatusMark = state.preferencesOpen.mark
self.windowController.showWindow(self)
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let emit: (Action) -> Void

View File

@ -113,7 +113,7 @@ class PreviewTool: NSView, UiComponent, WKNavigationDelegate {
self.webview.navigationDelegate = nil
self.webview.removeFromSuperview()
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
self.webviewMessageHandler.source
.throttle(0.75, latest: true, scheduler: self.scheduler)
@ -122,7 +122,7 @@ class PreviewTool: NSView, UiComponent, WKNavigationDelegate {
self.scrollTop = scrollTop
self.emit(UuidAction(uuid: self.uuid, action: .scroll(to: self.previewPosition)))
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate func addViews() {

View File

@ -40,7 +40,7 @@ class UiRoot: UiComponent {
NSApp.terminate(self)
}
})
.addDisposableTo(self.disposeBag)
.disposed(by: self.disposeBag)
}
fileprivate let source: Observable<AppState>