Closed amcdnl closed 10 years ago
Javascript will execute the function immediately with this syntax (it won't wait for the watch). This is probably not what you want to do. You will need to wrap it in a function, there is no way around this.
An interesting approach might be to allow string interpolation with 'mixins' like:
'{object}report:debounce(500)': this.SearchModel.findAll
execute everything : and pass args in () to the fn
When I do a watch, I often need to debounce the call, instead of having to define a function it would be nice to use this utility directly.
Problem is the
this
reference is window in this case:The debounce is a factory utility, code here: https://gist.github.com/amcdnl/9238250