Get rid of the initialize method

This commit is contained in:
Ben Ogle
2016-02-25 16:33:39 -08:00
parent 1cd530cdf0
commit 418b1bd8f1
3 changed files with 9 additions and 11 deletions

View File

@@ -4,23 +4,21 @@ import {Emitter, CompositeDisposable} from 'event-kit'
import {ipcRenderer} from 'electron'
export default class AutoUpdateManager {
constructor () {
constructor ({applicationDelegate}) {
this.subscriptions = new CompositeDisposable()
this.emitter = new Emitter()
}
initialize (updateEventEmitter) {
this.subscriptions.add(
updateEventEmitter.onDidBeginCheckingForUpdate(() => {
applicationDelegate.onDidBeginCheckingForUpdate(() => {
this.emitter.emit('did-begin-checking-for-update')
}),
updateEventEmitter.onDidBeginDownloadingUpdate(() => {
applicationDelegate.onDidBeginDownloadingUpdate(() => {
this.emitter.emit('did-begin-downloading-update')
}),
updateEventEmitter.onDidCompleteDownloadingUpdate((details) => {
applicationDelegate.onDidCompleteDownloadingUpdate((details) => {
this.emitter.emit('did-complete-downloading-update', details)
}),
updateEventEmitter.onUpdateNotAvailable(() => {
applicationDelegate.onUpdateNotAvailable(() => {
this.emitter.emit('update-not-available')
})
)