Skip to content

Commit

Permalink
docs: es6ify 'Breaking Changes' and 'File' API pages (#15507)
Browse files Browse the repository at this point in the history
* docs: apply arrow functions to app.makeSingleInstance example

* docs: apply arrow functions to session docs

* docs: change normal to arrow functions in File object docs
  • Loading branch information
Moisés Neto authored and MarshallOfSound committed Dec 5, 2018
1 parent d561c55 commit cfbea4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/api/breaking-changes.md
Expand Up @@ -30,13 +30,13 @@ The following list includes the breaking API changes planned for Electron 4.0.

```js
// Deprecated
app.makeSingleInstance(function (argv, cwd) {

app.makeSingleInstance((argv, cwd) => {
/* ... */
})
// Replace with
app.requestSingleInstanceLock()
app.on('second-instance', function (event, argv, cwd) {

app.on('second-instance', (event, argv, cwd) => {
/* ... */
})
```

Expand Down Expand Up @@ -212,11 +212,11 @@ screen.getPrimaryDisplay().workArea

```js
// Deprecated
ses.setCertificateVerifyProc(function (hostname, certificate, callback) {
ses.setCertificateVerifyProc((hostname, certificate, callback) => {
callback(true)
})
// Replace with
ses.setCertificateVerifyProc(function (request, callback) {
ses.setCertificateVerifyProc((request, callback) => {
callback(0)
})
```
Expand Down
8 changes: 4 additions & 4 deletions docs/api/file-object.md
Expand Up @@ -15,15 +15,15 @@ Example of getting a real path from a dragged-onto-the-app file:
</div>

<script>
document.addEventListener('drop', function (e) {
document.addEventListener('drop', (e) => {
e.preventDefault();
e.stopPropagation();
for (let f of e.dataTransfer.files) {
for (const f of e.dataTransfer.files) {
console.log('File(s) you dragged here: ', f.path)
}
});
document.addEventListener('dragover', function (e) {
document.addEventListener('dragover', (e) => {
e.preventDefault();
e.stopPropagation();
});
Expand Down

0 comments on commit cfbea4a

Please sign in to comment.