I'm trying to use lodash _.debounce
function for canjs
DefineMap
view-model method but it seems that this
is tricky even I tried to do it in the init
method but without success:
export const ViewModel = DefineMap.extend({
init() {
this.myMethod = _.debounce(this.myMethod, 200)
},
myMethod() {
// cool stuff here
}
})
Any help is appreciated!