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:
parent
090b5986e8
commit
9b9da5c4cf
@ -47,7 +47,7 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
|||||||
self.updateViews()
|
self.updateViews()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let emit: (Action) -> Void
|
fileprivate let emit: (Action) -> Void
|
||||||
|
@ -79,7 +79,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
self.setSparkleUrl(self.useSnapshot)
|
self.setSparkleUrl(self.useSnapshot)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let stateContext: Context
|
fileprivate let stateContext: Context
|
||||||
|
@ -57,7 +57,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
|||||||
self.updateViews()
|
self.updateViews()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let emit: (Action) -> Void
|
fileprivate let emit: (Action) -> Void
|
||||||
|
@ -47,7 +47,7 @@ class Context {
|
|||||||
)
|
)
|
||||||
.merge()
|
.merge()
|
||||||
.subscribe(onNext: self.emitAppState)
|
.subscribe(onNext: self.emitAppState)
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
|
|
||||||
// MainWindow.State
|
// MainWindow.State
|
||||||
Observable
|
Observable
|
||||||
@ -79,7 +79,7 @@ class Context {
|
|||||||
)
|
)
|
||||||
.merge()
|
.merge()
|
||||||
.subscribe(onNext: self.emitAppState)
|
.subscribe(onNext: self.emitAppState)
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
Observable
|
Observable
|
||||||
@ -100,11 +100,11 @@ class Context {
|
|||||||
.merge()
|
.merge()
|
||||||
.apply(to: prefService.forPrefPanes)
|
.apply(to: prefService.forPrefPanes)
|
||||||
.subscribe(onNext: self.emitAppState)
|
.subscribe(onNext: self.emitAppState)
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
// actionSource.debug().subscribe().addDisposableTo(self.disposeBag)
|
// actionSource.debug().subscribe().disposed(by: self.disposeBag)
|
||||||
// stateSource.debug().subscribe().addDisposableTo(self.disposeBag)
|
// stateSource.debug().subscribe().disposed(by: self.disposeBag)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class FileBrowser: NSView,
|
|||||||
self.currentBufferUrl = state.currentBuffer?.url
|
self.currentBufferUrl = state.currentBuffer?.url
|
||||||
self.showHiddenMenuItem.boolState = state.fileBrowserShowHidden
|
self.showHiddenMenuItem.boolState = state.fileBrowserShowHidden
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let emit: (UuidAction<Action>) -> Void
|
fileprivate let emit: (UuidAction<Action>) -> Void
|
||||||
|
@ -55,7 +55,7 @@ class FileMonitor: UiComponent {
|
|||||||
self.monitors.removeValue(forKey: url)
|
self.monitors.removeValue(forKey: url)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let emit: (Action) -> Void
|
fileprivate let emit: (Action) -> Void
|
||||||
|
@ -73,7 +73,7 @@ class FileOutlineView: NSOutlineView,
|
|||||||
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
|
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
|
||||||
self.update(state.lastFileSystemUpdate.payload)
|
self.update(state.lastFileSystemUpdate.payload)
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
func select(_ url: URL) {
|
func select(_ url: URL) {
|
||||||
|
@ -55,7 +55,7 @@ class GeneralPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
|||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let emit: (Action) -> Void
|
fileprivate let emit: (Action) -> Void
|
||||||
|
@ -67,7 +67,7 @@ class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate {
|
|||||||
self.mark = serverUrl.mark
|
self.mark = serverUrl.mark
|
||||||
self.reloadWebview(with: serverUrl.payload)
|
self.reloadWebview(with: serverUrl.payload)
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate func reloadWebview(with url: URL) {
|
fileprivate func reloadWebview(with url: URL) {
|
||||||
|
@ -151,7 +151,7 @@ class MainWindow: NSObject,
|
|||||||
.subscribe(onNext: { [unowned self] action in
|
.subscribe(onNext: { [unowned self] action in
|
||||||
self.emit(self.uuidAction(for: action))
|
self.emit(self.uuidAction(for: action))
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
|
|
||||||
self.addViews()
|
self.addViews()
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ class MainWindow: NSObject,
|
|||||||
onCompleted: {
|
onCompleted: {
|
||||||
self.windowController.close()
|
self.windowController.close()
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
|
|
||||||
self.updateNeoVimAppearance()
|
self.updateNeoVimAppearance()
|
||||||
self.neoVimView.delegate = self
|
self.neoVimView.delegate = self
|
||||||
|
@ -89,7 +89,7 @@ class OpenQuicklyWindow: NSObject,
|
|||||||
|
|
||||||
self.windowController.showWindow(self)
|
self.windowController.showWindow(self)
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
func reloadFileView(withScoredItems items: [ScoredFileItem]) {
|
func reloadFileView(withScoredItems items: [ScoredFileItem]) {
|
||||||
|
@ -46,7 +46,7 @@ class OpenedFileList: NSView,
|
|||||||
self.bufferList.reloadData()
|
self.bufferList.reloadData()
|
||||||
self.adjustFileViewWidth()
|
self.adjustFileViewWidth()
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let emit: (UuidAction<Action>) -> Void
|
fileprivate let emit: (UuidAction<Action>) -> Void
|
||||||
|
@ -53,7 +53,7 @@ class PrefWindow: NSObject,
|
|||||||
self.openStatusMark = state.preferencesOpen.mark
|
self.openStatusMark = state.preferencesOpen.mark
|
||||||
self.windowController.showWindow(self)
|
self.windowController.showWindow(self)
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let emit: (Action) -> Void
|
fileprivate let emit: (Action) -> Void
|
||||||
|
@ -113,7 +113,7 @@ class PreviewTool: NSView, UiComponent, WKNavigationDelegate {
|
|||||||
self.webview.navigationDelegate = nil
|
self.webview.navigationDelegate = nil
|
||||||
self.webview.removeFromSuperview()
|
self.webview.removeFromSuperview()
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
|
|
||||||
self.webviewMessageHandler.source
|
self.webviewMessageHandler.source
|
||||||
.throttle(0.75, latest: true, scheduler: self.scheduler)
|
.throttle(0.75, latest: true, scheduler: self.scheduler)
|
||||||
@ -122,7 +122,7 @@ class PreviewTool: NSView, UiComponent, WKNavigationDelegate {
|
|||||||
self.scrollTop = scrollTop
|
self.scrollTop = scrollTop
|
||||||
self.emit(UuidAction(uuid: self.uuid, action: .scroll(to: self.previewPosition)))
|
self.emit(UuidAction(uuid: self.uuid, action: .scroll(to: self.previewPosition)))
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate func addViews() {
|
fileprivate func addViews() {
|
||||||
|
@ -40,7 +40,7 @@ class UiRoot: UiComponent {
|
|||||||
NSApp.terminate(self)
|
NSApp.terminate(self)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addDisposableTo(self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate let source: Observable<AppState>
|
fileprivate let source: Observable<AppState>
|
||||||
|
Loading…
Reference in New Issue
Block a user