Skip to content

Instantly share code, notes, and snippets.

@bushev
Created March 4, 2019 02:21
Show Gist options
  • Save bushev/fe5c4e64126e3099a408199e55dc174f to your computer and use it in GitHub Desktop.
Save bushev/fe5c4e64126e3099a408199e55dc174f to your computer and use it in GitHub Desktop.

Add method handleDroppedFile:

async handleDroppedFile(payload) {

  this.broker.emit('compressor.compressed', {
    id: payload.id,
    ...await this.compressFile(payload.filePath)
  });
}

Declare new event handler in a service schema definition:

events: {
  'electron.file-dropped': this.handleDroppedFile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment