Rename also function name transformer for Axios

This commit is contained in:
Freezeboy 2015-07-28 16:46:00 +02:00
parent 915ed652e1
commit 2c0fe980eb
2 changed files with 4 additions and 4 deletions

View file

@ -17,11 +17,11 @@
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('load', function() { window.addEventListener('load', function() {
// we get the current value stored by the server when the page is loaded // we get the current value stored by the server when the page is loaded
getcounter().then(updateCounter).catch(alert); getCounter().then(updateCounter).catch(alert);
// we update the value every 1sec, in the same way // we update the value every 1sec, in the same way
window.setInterval(function() { window.setInterval(function() {
getcounter().then(updateCounter).catch(alert); getCounter().then(updateCounter).catch(alert);
}, 1000); }, 1000);
}); });
@ -33,7 +33,7 @@ function updateCounter(response)
// when the button is clicked, ask the server to increase // when the button is clicked, ask the server to increase
// the value by one // the value by one
document.getElementById('inc').addEventListener('click', function() { document.getElementById('inc').addEventListener('click', function() {
postcounter().then(updateCounter).catch(alert); postCounter().then(updateCounter).catch(alert);
}); });
</script> </script>
</body> </body>

View file

@ -112,7 +112,7 @@ generateAxiosJSWith aopts opts req = "\n" <>
where where
hasNoModule = null (moduleName opts) hasNoModule = null (moduleName opts)
fname = namespace <> (functionRenamer opts $ req ^. funcName) fname = namespace <> (functionNameBuilder opts $ req ^. funcName)
method = map toLower $ req ^. reqMethod method = map toLower $ req ^. reqMethod
url = if url' == "'" then "'/'" else url' url = if url' == "'" then "'/'" else url'