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
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.