Last active
February 7, 2019 06:58
-
-
Save vldvel/8c6037d1296850fa7c1345e3f9d4f01f to your computer and use it in GitHub Desktop.
update in middleware
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 updateMessagesMiddleware = ({ dispatch }) => next => { | |
const updateMessages = async () => { | |
await getNewMessages()(dispatch); | |
setTimeout(updateMessages, 500); | |
}; | |
updateMessages(); | |
return action => next(action); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment