on master help sign in
Rename also function name transformer for Axios
commit2c0fe980eb4b2d999b4208b072946ba986948852 authorFreezeboy <freezeboy@users.noreply.github.com> dateTue 28 Jul 2015, 16:46 (11 years ago) parent915ed65
2 files changed+4−4
servant-js/examples/www/axios/index.html+3−3 servant-js/src/Servant/JS/Axios.hs+1−1
servant-js/examples/www/axios/index.html+3−3
@@ -17,11 +17,11 @@
1717<script type="text/javascript">
1818window.addEventListener('load', function() {
1919 // we get the current value stored by the server when the page is loaded
20− getcounter().then(updateCounter).catch(alert);
20+ getCounter().then(updateCounter).catch(alert);
2121
2222 // we update the value every 1sec, in the same way
2323 window.setInterval(function() {
24− getcounter().then(updateCounter).catch(alert);
24+ getCounter().then(updateCounter).catch(alert);
2525 }, 1000);
2626});
2727
@@ -33,7 +33,7 @@ function updateCounter(response)
3333// when the button is clicked, ask the server to increase
3434// the value by one
3535document.getElementById('inc').addEventListener('click', function() {
36− postcounter().then(updateCounter).catch(alert);
36+ postCounter().then(updateCounter).catch(alert);
3737});
3838</script>
3939</body>
servant-js/src/Servant/JS/Axios.hs+1−1
@@ -112,7 +112,7 @@ generateAxiosJSWith aopts opts req = "\n" <>
112112 where
113113 hasNoModule = null (moduleName opts)
114114
115− fname = namespace <> (functionRenamer opts $ req ^. funcName)
115+ fname = namespace <> (functionNameBuilder opts $ req ^. funcName)
116116
117117 method = map toLower $ req ^. reqMethod
118118 url = if url' == "'" then "'/'" else url'