Created
September 3, 2021 08:38
-
-
Save warodri-sendbird/710552845828c264feca5468e37d57e1 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
const next = () => { | |
if (query.hasMore) { | |
dispatch({ type: 'error', payload: { error: '' } }); | |
query.limit = 50; | |
query.reverse = true; | |
query.load((err, fetchedMessages) => { | |
if (!err) { | |
dispatch({ type: 'fetch-messages', payload: { messages: fetchedMessages } }); | |
} else { | |
dispatch({ type: 'error', payload: { error: 'Failed to get the messages.' } }); | |
} | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment