docs: Update breaking changes on webFrame.setSpellCheckProvider (#17915)

* doc: Update breaking changes on webFrame.setSpellCheckProvider

* doc: fix example

* doc: lint: extra semicolon

* Update docs/api/breaking-changes.md

Co-Authored-By: magne4000 <joel.charles91@gmail.com>
This commit is contained in:
Joël Charles 2019-06-03 20:56:46 +02:00 committed by Charles Kerr
parent 0ee2f8a64a
commit fd9e031f0d

View file

@ -200,6 +200,23 @@ webFrame.setIsolatedWorldInfo(
})
```
## `webFrame.setSpellCheckProvider`
The `spellCheck` callback is now asynchronous, and `autoCorrectWord` parameter has been removed.
```js
// Deprecated
webFrame.setSpellCheckProvider('en-US', true, {
spellCheck: (text) => {
return !spellchecker.isMisspelled(text)
}
})
// Replace with
webFrame.setSpellCheckProvider('en-US', {
spellCheck: (words, callback) => {
callback(words.filter(text => spellchecker.isMisspelled(text)))
}
})
```
## Planned Breaking API Changes (4.0)
The following list includes the breaking API changes made in Electron 4.0.