JSFiddle - React, Tailwind, and code Playground
by yngvebn
HTML
<button class="actionButton" data-action="delete">Click me</button>
JavaScript
var mymodule = function() {
var self = this;
init = function () {
$('.actionButton').click(function () {
var worklistId = $(this).data('worklistid'), action = $(this).data('action');
self[action] && self[action](worklistId); //watchout methods marked as not used are used by this invocation
})
}
self.send = function () {
// some logic
}
self.finish = function () {
// some logic
}
self.delete = function () {
console.log('delete');
};
return {
init: init,
};
}();
mymodule.init();