Skip to content

Commit

Permalink
fix debounce for tweet and image api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Feb 7, 2019
1 parent 407ee94 commit 3115b3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/api.js
Expand Up @@ -18,7 +18,7 @@ const gistClient = axios.create({
}
})

async function tweet(content, encodedImage) {
function tweet(content, encodedImage) {
const processedData = encodedImage.split(',')[1]

return client
Expand Down Expand Up @@ -70,6 +70,6 @@ function checkIfRateLimited(err) {
export default {
client,
getGist,
tweet: debounce(tweet, ms('5s'), { leading: true, trailing: true }),
image: debounce(image, ms('5s'), { leading: true, trailing: true })
tweet: debounce(tweet, ms('5s'), { leading: true, trailing: false }),
image: debounce(image, ms('5s'), { leading: true, trailing: false })
}

0 comments on commit 3115b3c

Please sign in to comment.