Closed Yeti-or closed 7 years ago
We need a guard against recursion deadlock.
Another example https://goo.gl/EbKDW3
@golyshevd thank you. In current bem-xjst you can not use apply()
in match()
.
@miripiruni why not? is it feature? )
@golyshevd it happened :) I’ll try to fix it.
@miripiruni Thanks!
Guys, let's resurrect this issue. We encountered this problem again.
@remnev can you show your usecase please?
block('foo')(
mode('is-empty')(true),
content()(
match(() => !apply('is-empty'))('text')
)
);
For example, I have a mode, which returns some data or nothing. Depends on it I want to output different content.
// one case: returns "text"
block('foo')(
mode('is-empty')(true),
content()(
'–',
match(() => apply('is-empty'))('text')
)
);
// another case: returns "–"
block('foo').mod('a', 'b')(
mode('is-empty')(false)
);
@remnev thanks.
I don't think that it is good pattern but when you try to use apply inside match u get an Error: example
Maybe we need to handle this error and continue to process template, or fix this.