Open narqo opened 9 years ago
For (1):
ctx.mod('myMod', 'myVal'); // bh.js
So it will be nice if we would have:
this.ctx.mod...
@zxqfox the problem is more generic, because item
in example above, could be any object from context (e.g. item = json.items[1]
in bh terms).
For the case you showed, you should use this.mods.myMod = 'myVal'
.
Oh, you mean while creating bemjson node on the fly. Then something like item = ctx.makeNode(item);
that will create mods
and probably other standard fields.
Proposal for the second:
// (1)
mix()(function() {
return (ctx.mix || []).concat(apply('mix'));
})
or if ctx.mix will be prefedined as standard bemjson node field with default value []
:
// (2)
mix()(function() {
return ctx.mix.concat(apply('mix'));
})
or a real helper...
for mixes: #820
We have a lot of stuff like:
1.
2.