marpple/FxJS

[bug]debounce - this is undefined

wnghdcjfe opened this issue · 1 comments

debounce - this is undefined

I like fxjs more than lodash
in my vue js project, debounce-this issue is occured

import _ from 'lodash';
import {debounce} from 'fxjs2'; 
      debounceInput : debounce(function(e){  
        console.log(this) // undefined
        if(vm.password !== e.target.value){   
          vm.isSamePW = true;
        }else vm.isSamePW = false; 
      }, 500).bind(this), 
      debounceInput : _.debounce(function(e){  
        console.log(this) // Vue component
        if(vm.password !== e.target.value){   
          vm.isSamePW = true;
        }else vm.isSamePW = false; 
      },500),  

I think this is bug.

Hi, thanks for your issue opening.

We're currently not supporting 'this' binding for our functions. But, we will consider 'this' binding for next step. Until then, please use lodash for debounce rather than fxjs.

Thank you.