Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Use ES6 arrow functions more (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlatanvasovic authored and addaleax committed Apr 9, 2017
1 parent 8bb3233 commit 431af0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const major = v => v.split('.')[0]

const installing = {
run: false,
start: function () {
start() {
domElement('#installing').style.display = 'block'
this.run = true
},
done: function () {
done() {
domElement('#installing').style.display = 'none'
this.run = false
}
Expand Down
2 changes: 1 addition & 1 deletion lib/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fs.readFile(file, function (err, contents) {
})
`}]

module.exports = function (callback) {
module.exports = (callback) => {
const { title, code } = examples[Math.floor(Math.random() * examples.length)]
callback(title, code)
}
6 changes: 3 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function createWindow () {
mainWindow.webContents.openDevTools()

// Emitted when the window is closed.
mainWindow.on('closed', function () {
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
Expand All @@ -37,15 +37,15 @@ function createWindow () {
app.on('ready', createWindow)

// Quit when all windows are closed.
app.on('window-all-closed', function () {
app.on('window-all-closed', () => {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})

app.on('activate', function () {
app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
Expand Down

0 comments on commit 431af0c

Please sign in to comment.