diff --git a/lib/api.js b/lib/api.js index 36d84fe..982ab0b 100644 --- a/lib/api.js +++ b/lib/api.js @@ -109,11 +109,16 @@ function deleteSnippet(uid) { }) } +const createSnippet = debounce(data => updateSnippet(null, data), ms('5s'), { + leading: true, + trailing: false +}) + export default { snippet: { get: getSnippet, update: debounce(updateSnippet, ms('1s'), { leading: true, trailing: true }), - create: data => updateSnippet(null, data), + create: createSnippet, delete: id => deleteSnippet(id) }, tweet: debounce(tweet, ms('5s'), { leading: true, trailing: false }),