1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 04:34:00 +02:00

update editor.change() to use change.call(), update docs

This commit is contained in:
Ian Storm Taylor
2017-10-18 01:42:36 -07:00
parent a802e74bb0
commit d66e127e7d
2 changed files with 55 additions and 11 deletions

View File

@@ -250,15 +250,14 @@ class Editor extends React.Component {
}
/**
* Perform a change `fn` on the editor's current state.
* Perform a change on the editor, passing `...args` to `change.call`.
*
* @param {Function} fn
* @param {Mixed} ...args
*/
change = (fn) => {
change = (...args) => {
const { state } = this.state
const change = state.change()
fn(change)
const change = state.change().call(...args)
debug('change', { change })
this.onChange(change)
}