5 ms·
data-actions-on-response=" mapToTemplate('${someResponse.body}', '#box'); showElms('#box'); logToConsole('statusCode:', '${someResponse.status
by stevebmark 7y ago
data-actions-on-response="
mapToTemplate('${someResponse.body}', '#box');
showElms('#box');
logToConsole('statusCode:', '${someResponse.statusCode}');
"
oh my god
- JMTQp8lwXL 7y agoI'm assuming it evals it, or runs it through some parser and does parameter replacement before executing.
- guseyn 7y agoit evals, but only some part of it, so it prevents XSS attacks
- eberkund 7y agoLooks familiar, someAttributeNvmWeCallThemProps={(someResponse) => { mapToTemplate('${someResponse.body}', '#box'); showElms('#box'); logToConsole('statusCode:', '${someResponse.statusCode}'); }}
- evv 7y agoSure it is similar to JS/React, but you're missing out on lint tools, TS, flow, reasonml, or other tools that help you catch errors.
- eberkund 7y agoI don't know why React people always say that unless you're using JSX you miss out on lint tools. VueJS templates use "" instead of {} but you still get all the lint tools you'd expect.
- stevebmark 7y agono, this looks like a nightmare leaky abstraction imperative API with non statically analyzable code like '#box'
- guseyn 7y ago#box is just a selector, it means element with id box, and you can see errors like "element is not found" anyway