debounce carbon duplication

main
Mike Fix 5 years ago
parent e0ed4bebdc
commit 15710e8ab6

@ -109,11 +109,16 @@ function deleteSnippet(uid) {
}) })
} }
const createSnippet = debounce(data => updateSnippet(null, data), ms('5s'), {
leading: true,
trailing: false
})
export default { export default {
snippet: { snippet: {
get: getSnippet, get: getSnippet,
update: debounce(updateSnippet, ms('1s'), { leading: true, trailing: true }), update: debounce(updateSnippet, ms('1s'), { leading: true, trailing: true }),
create: data => updateSnippet(null, data), create: createSnippet,
delete: id => deleteSnippet(id) delete: id => deleteSnippet(id)
}, },
tweet: debounce(tweet, ms('5s'), { leading: true, trailing: false }), tweet: debounce(tweet, ms('5s'), { leading: true, trailing: false }),

Loading…
Cancel
Save