1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 19:01:54 +02:00

Convert setBlock and setInline to plurals for more intuitive naming. (#1558)

This commit is contained in:
Zach Schneider
2018-02-21 21:03:30 -05:00
committed by Ian Storm Taylor
parent e6638f7822
commit c5f0626a05
26 changed files with 86 additions and 52 deletions

View File

@@ -25,7 +25,7 @@ class App extends React.Component {
event.preventDefault()
const isCode = change.value.blocks.some(block => block.type == 'code')
change.setBlock(isCode ? 'paragraph' : 'code')
change.setBlocks(isCode ? 'paragraph' : 'code')
return true
}
@@ -76,7 +76,7 @@ class App extends React.Component {
case '`': {
const isCode = change.value.blocks.some(block => block.type == 'code')
event.preventDefault()
change.setBlock(isCode ? 'paragraph' : 'code')
change.setBlocks(isCode ? 'paragraph' : 'code')
return true
}
}
@@ -143,7 +143,7 @@ class App extends React.Component {
case '`': {
const isCode = change.value.blocks.some(block => block.type == 'code')
event.preventDefault()
value.setBlock(isCode ? 'paragraph' : 'code')
value.setBlocks(isCode ? 'paragraph' : 'code')
return true
}
}

View File

@@ -139,7 +139,7 @@ class App extends React.Component {
event.preventDefault()
// Otherwise, set the currently selected blocks type to "code".
change.setBlock('code')
change.setBlocks('code')
return true
}
@@ -196,7 +196,7 @@ class App extends React.Component {
const isCode = change.value.blocks.some(block => block.type == 'code')
// Toggle the block type depending on `isCode`.
change.setBlock(isCode ? 'paragraph' : 'code')
change.setBlocks(isCode ? 'paragraph' : 'code')
return true
}