wrap

'wraps' a function around the original function

function wrap(function target,function source);
targetfunctionthe function to wrap. It receives the new logic
sourcefunctiona function that contains the logic to wrap
functionthe target object 'wrapped' around by the new logic

Example

list.add = webix.wrap(list.add, function(obj, index){
    //log all data adding operations
    console.log("add "+obj.id);
});

Back to top