-
Notifications
You must be signed in to change notification settings - Fork 72
Add shortcut for deps from multiple elems #401
Comments
cc @veged |
shouldDeps : [
{ block : 'blah', elems : ['e1', 'e2'] }
] ? |
@narqo, i need deps only from elems, not including the block. |
@dfilatov Try shouldDeps : [
{ elems : ['e1', 'e2'] }
] |
@arikon that's the same as @narqo suggested -- but we need possibility to declare elements without block declaration, i.e. |
@veged I've got it |
@SevInf Have a look at this, please |
Won't it be confusing? This code shouldDeps: { block: 'blah', elem: ['e1', 'e2'] } looks almost like this: shouldDeps : [
{ block : 'blah', elems : ['e1', 'e2'] }
] and difference between them is not obvious without looking into documentation. shouldDeps: [
{elems:['e1', 'e2'], ofBlock: 'blah'}
] |
I prefer originally described variant as more consistent with current deps.js format. Yes, it's not obvious at all, but if we need something more "literature" and "verbose" we should architect fully new version of deps.js format. Also, you always have an option to not use shortcuts and write more verbose and obvious instead of On 22.08.2013, at 6:48, Sergej Tatarincev notifications@github.com wrote:
|
IMHO, original proposal will make API more inconsistent - we'll basically have same construction meaning different things depending whether or not its an element of an array. It is also very error-prone. When I have a dependency on shouldDeps: {
block: 'block1', elem: ['e1', 'e2']
} if I need to depend on shouldDeps: [
{block: 'block1', elem: ['e1', 'e2']},
{block: 'block2', elem: ['e3', 'e4']},
} But instead I'll get a different behavior without any warning. |
There is no differences in using array or single string, they both mean the same — depend on some elems (without depending on block itself). On 22.08.2013, at 9:59, Sergej Tatarincev notifications@github.com wrote:
|
это нужно портировать в соответствующую v2-технологию |
@SevInf Готово к портированию |
Please move this logic to external module and standartize it. I find some places very confusing (including this one). |
Also this shouldDeps : ['e1', 'e2'].map(function (e) { return {block: 'b1', elem: e}; }); And definatly not be included in deps standard. |
@floatdrop doesn't agree with |
@veged There is another variant with arrows.
But Can I suggest that you want to cancel including block itself by default and deprecate |
@zxqfox I'm not gonna discuss about arrows ;-) sorry ;-) speakings about confusing — there is some because of just small letter
|
Yes, but actually that's not clear:
I'm not sure but probably if just freeze naming pattern for internal uses (if we need it) we can use just these:
That's a quietly another format but feels like we are in the deadlock. Need to think different. Maybe just implement
So the legend will be simple: includes all described in the root. |
@floatdrop @veged Is this abandoned? |
@zxqfox maybe. |
If i need deps from multiple elems of block, i should use:
It would be more convenient if I could write so:
The text was updated successfully, but these errors were encountered: