Last active
September 8, 2020 12:40
-
-
Save duytq94/d0de73ee43582eee05f178f01a1e6ec2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syncDb = () => { | |
this.setState({isLoading: true}) | |
handlerSync = PouchDB.sync(remoteNoteDb, localNoteDb, { | |
live: true, | |
retry: true, | |
}) | |
.on('change', (info) => { | |
// console.log(TAG, 'sync onChange', info) | |
}) | |
.on('paused', (err) => { | |
// console.log(TAG, 'sync onPaused', err) | |
if (this.isAtCurrentScreen) { | |
this.getListNoteFromDb() | |
} | |
}) | |
.on('active', () => { | |
// console.log(TAG, 'sync onActive') | |
}) | |
.on('denied', (err) => { | |
// console.log(TAG, 'sync onDenied', err) | |
}) | |
.on('complete', (info) => { | |
// console.log(TAG, 'sync onComplete', info) | |
}) | |
.on('error', (err) => { | |
// console.log(TAG, 'sync onError', err) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment