NetanelBasal / helpful-decorators

Helpful decorators for typescript projects

Home Page:https://netbasal.com/create-and-test-decorators-in-javascript-85e8d5cf879c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debounce no longer passes arguments

rrajewski opened this issue · comments

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report 
[x] Feature request
[ ] Documentation issue or request

Current behavior

Adding debounce to a function with parameters, no longer forwards the arguments when the function is called.

example: https://stackblitz.com/edit/angular-fggoh2

@debounce(300)
  log(newVal){
    this.name = newVal; //newVal is always undefined.
  }

I think ln

should be
debounced.apply(this, arguments);

Expected behavior

@debounce(300)
  log(newVal){
    this.name = newVal; 
  }

newVal would be the value passed on the last call.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-fggoh2

What is the motivation / use case for changing the behavior?

Environment

Browser:

  • [x ] Chrome (desktop) version XX
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

We missed this, you are right, thanks.