Last active
September 30, 2018 13:52
-
-
Save ivanaugustobd/42a8020400d639595f50704c278f8398 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 submitForm = (form, callback = null) => { | |
// [..] | |
fetch(form.action, [..]) | |
.then(response => { | |
// [..] | |
if (callback) { | |
callback(response) // executa a função personalizada que varia pra cada form, passando a response pra ela | |
} | |
}) | |
// [..] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment