BackburnerJS / backburner.js

A rewrite of the Ember.js run loop as a generic microlibrary
MIT License
392 stars 80 forks source link

deprecate passing context and method name #346

Closed bekzod closed 1 year ago

bekzod commented 5 years ago

parsing arguments in backburner is big process, since it allows different permutations of arguments
https://github.com/BackburnerJS/backburner.js/blob/master/lib/index.ts#L31-L117 Wouldn't it be better if we reduce allowed argument combinations by removing passing context and method name, it would reduce argument parsing code hence reduce amount of work done each time we call run/debouce/throttle/....

following:

   run(this, function(){})
   run(this, 'myMethod')

could be rewritten as

   run(()=> {})
   run(()=> this.myMethod())

or

   run(function(){}.bind(this))
   run(this.myMethod.bind(this))