Change interface of .act() callback functions
arikon opened this issue · 3 comments
arikon commented
My proposal it to change API of .act()
callbacks from
function(opts, args) {
}
to
function(options) {
// options = opts + args
}
Motivation
-
The difference between
opts
andargs
in semantical only and only make sense when command is run from the command line -
It is hard to explain to develepor what the difference between
opts
andargs
when it uses COA API to run command -
Division into two different arguments makes sense in case when
opts
is a hash andargs
is an array -
Compare
var BEM = require('bem'); BEM.api.create.block({ tech: ['css', 'js'] }, { names: ['b1', 'b2'] });
and
var BEM = require('bem'); BEM.api.create.block({ names: ['b1', 'b2'], tech: ['css', 'js'] });
/cc @veged
veged commented
we can just add args
to opts
but keep second argument for act
function for full backward compatibility