Last active
June 30, 2020 13:04
-
-
Save pwm1991/ca13e3433dc0d29f6340b700e7b17889 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Query a JS Function with Args in a Tag | |
| // Quote args even if not a string. | |
| {{ Variable }}("{{ Varible }}") | |
| // e.g.: | |
| {{function parseFloat x100}}("{{transactionTotal}}") | |
| // The variable needs to return a fn with the desired args: | |
| function() { | |
| return function(input) { | |
| // do stuff | |
| return input | |
| } | |
| } | |
| // Fns within variables is slightly different: | |
| function() { | |
| let var = (function() { | |
| return target.test(input) ? true : false | |
| } () | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment