I have a function callWithMagic
which takes a callback function as a parameter and calls it with one argument.
const callWithMagic = callback =&
You can create a function which calls the marketEvent
function. No need to complicate things
session.sub('Hello', function(args, kwargs) {
marketEvent(args, kwargs, 'my custom data');
});
otherwise you can do this:
var mrktEvent = function(customArgs) {
return function(args, kwargs) {
marketEvent(args, kwargs, customArgs)
};
}
session.sub('Hello', mrktEvent("customEvent"));