1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

cancel dispatch queue before focrcing & shorter dispatch latency

This commit is contained in:
Dick Choi
2016-05-31 21:39:42 +09:00
parent eeda6b0208
commit 0c2226b3fc

View File

@@ -22,6 +22,7 @@ class NoteDetail extends React.Component {
componentWillReceiveProps (nextProps) {
if (nextProps.note.key !== this.props.note.key) {
if (this.state.isDispatchQueued) {
this.cancelDispatchQueue()
this.dispatch()
}
this.setState({
@@ -92,7 +93,7 @@ class NoteDetail extends React.Component {
this.setState({
isDispatchQueued: false
})
}, 500)
}, 100)
}
dispatch () {